分级策略:<64KB 使用 cyrb53,>=64KB 使用 SHA-1
分级策略:<64KB 使用 cyrb53,>=64KB 使用 SHA-1
(inner) cyrb53(bytes) → {string}
cyrb53 — 非密码学哈希,适用于小文件(< 64 KB)
参数说明:
| Name | Type | Description |
|---|---|---|
bytes |
Uint8Array |
Returns:
16 字符 hex
- Type
- string
(async, inner) hashBytes(bytes) → {Promise.<string>}
统一哈希入口
参数说明:
| Name | Type | Description |
|---|---|---|
bytes |
Uint8Array | ArrayBuffer |
Returns:
hex 字符串
- Type
- Promise.<string>
(async, inner) sha1Hex(bytes) → {Promise.<string>}
SHA-1(浏览器原生),适用于大文件(≥ 64 KB)
参数说明:
| Name | Type | Description |
|---|---|---|
bytes |
Uint8Array |
Returns:
40 字符 hex
- Type
- Promise.<string>
module: hash