Algorithms
BLAKE2b-256
BLAKE2b with a 32-byte output. Sui addresses and Cardano transaction ids. Not half of the 64-byte digest
Hash / Cryptographic
BLAKE2b-256
BLAKE2b at 32 bytes, not half of the 64.
- Digest
- 256-bit · 32 bytes
- HMAC
- no key mode
- Security
- 128-bit collision resistance
- Used by
- Sui, Cardano
1 option, 0 required
Sample
- hex
- 256c83b297114d201b30179f3f0ef0cace9783622da5974326b436178aeef610
- base64
- JWyDspcRTSAbMBefPw7wys6Xg2ItpZdDJrQ2F4ru9hA=
Options
Access
- Create
create("blake2b-256") - CLI
hashes blake2b-256 'hello world' - Tryplayground with the sample above
- Kinsha256, sha384, sha512, sha512-half +11
BLAKE2b told up front to produce 32 bytes. The length goes into the parameter block, so the digest isn't the first half of BLAKE2b's:
create("blake2b-256").hash("abc").digest;
// "bddd813c634239723171ef3fee98579b94964e3bb1cb3e427262c8c068d52319"
create("blake2b").hash("abc").digest.slice(0, 64);
// "ba80a53f981c4d0d6a2797b69f12f6e94c212f14685ac4b74b12bb6fdbffa2d1", not the same
That's the mistake worth a page. Sui derives addresses with it, Cardano names transactions with it, and truncating the long one gives a digest that looks fine and that nobody will ever match. No HMAC mode.