跳到內文

STEMSTUDIO

Check a file is the real one

Files · computed on this device

Check a file is the real one

Drop a file and its hash is computed straight away. Paste the published value to see whether it matches.

  • Free, no account
  • Files are not uploaded

Help

Case, surrounding whitespace, separating colons and a trailing filename are all ignored. The algorithm is identified by length (8 = CRC32, 32 = MD5, 40 = SHA-1, 64 = SHA-256, 96 = SHA-384, 128 = SHA-512). MD5 and SHA-1 have demonstrated collisions: two different files can be made to produce the same value. They still work for "is this the same file the publisher shipped", but they cannot detect deliberate tampering. If the choice is yours, use SHA-256. CRC32 is an error-detecting checksum, not a hash — it is the same value ZIP files carry internally. It catches accidental corruption in transit and nothing more. Browsers normalise every line break in a text box to LF, so this will not match a file saved with CRLF line endings. To check a file, switch to the file mode above.

Processing, communication and stored data

為檔案或文字計算 SHA-256、SHA-512、SHA-384、SHA-1、MD5 和 CRC32,並與公佈的值比較。全部在瀏覽器中執行——什麼都不會上傳。

常見問題

我的檔案會被上傳嗎?

不會。讀取和計算都在瀏覽器中進行。關閉標籤頁後什麼都不會留下。

能處理多大的檔案?

SHA 演算法透過瀏覽器的雜湊 API 需要把整個檔案放進記憶體;大約 500MB 以上的檔案在某些裝置上可能失敗。只算 MD5/CRC32 時會按 2MB 分片讀取。計算留在你的裝置上,通常在獨立於介面的 worker 中執行。

值和釋出方的不一致,但本該一致

只要一個位元組不同,結果就完全不同,所以先確認貼上的值是完整的。另外請對下載下來的原樣檔案計算——用編輯器開啟再儲存,可能會改變換行或文字編碼,雜湊也就變了。

能用這個儲存密碼嗎?

不能。SHA-256 之類的雜湊是為快速而設計的,這對儲存密碼來說是錯誤的特性。請使用帶鹽和可調成本的專用方案,例如 bcrypt、scrypt 或 Argon2。

為什麼文字框和檔案得到的值不同?

瀏覽器會把文字框裡的所有換行統一成 LF。以 CRLF 換行儲存的檔案確實是不同的資料,所以雜湊不同。檢查檔案請用檔案模式。

應該怎樣驗證下載?

記下發布方公佈的值,在這裡計算下載檔案的雜湊,比較兩者。⚠️ 因為值和檔案來自同一個地方,控制了那個地方的攻擊者可以同時替換兩者。驗證能防止傳輸中的損壞和來自別處的副本——但不能防止釋出方本身被攻破。

比較開頭和結尾幾個字元夠嗎?

要發現意外損壞,夠了。針對故意篡改,不夠:攻擊者可以瞄準兩端看起來一致的值。威脅是篡改時,請比較每一位——從這裡複製值,用文字對比。

能對整個資料夾計算雜湊嗎?

不能。雜湊把一個位元組序列對映成一個值,沒有公認的方法把多個檔案合成一個。要檢查資料夾,先打包再對壓縮包計算——但要記住壓縮包會嵌入時間戳,用相同內容重新打包會得到不同的值。

Ratings from users

Ratings appear once there are 10.

Report a problem or suggest something

The tool name, this page’s path and your browser type are sent with it. Files are never sent. For a reply, use the email on the Contact page.