digest
Digest algorithms.
Types
| Type | Description |
|---|---|
State |
Supertype for digest state handles |
Blake3 |
BLAKE3 state handle |
Md5 |
MD5 state handle |
Sha1 |
SHA-1 state handle |
Sha256 |
SHA-256 state handle |
Sha512 |
SHA-512 state handle |
Functions
blake3 data
Computes the BLAKE3 digest.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
str|bin |
Input to hash |
Returns: bin - 32-byte digest
let digest = blake3 "abc"
assert_eq $digest.len 32
assert_eq $digest.hex()
6437b3ac38465133ffb63b75273a8db548c558465d79db03fd359c6cd5bd9d85
md5 data
Computes the MD5 digest.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
str|bin |
Input to hash |
Returns: bin - 16-byte digest
sha1 data
Computes the SHA-1 digest.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
str|bin |
Input to hash |
Returns: bin - 20-byte digest
sha256 data
Computes the SHA-256 digest.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
str|bin |
Input to hash |
Returns: bin - 32-byte digest
sha512 data
Computes the SHA-512 digest.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
str|bin |
Input to hash |
Returns: bin - 64-byte digest