# webcpp::hash > Hashing and key derivation for C++20 on every target webcpp has (native, wasip2, wasip3, Emscripten): Boost.Hash2's digests and HMAC, Keccak-256, BLAKE3, HKDF, PBKDF2, Argon2id, scrypt and the KDFs of NIST SP 800-108, SP 800-56C and ANSI X9.63 over C backends. Every synchronous function returns boost::system::result and allocates nothing in webcpp's own code; async.hpp gives the slow ones and the ones WebCrypto has an asynchronous form over webcpp::asio, and backends::webcrypto, the browser's WebCrypto, serves that form alone. A program links /webcpp/hash//hash and the library of each backend it uses. By default, hkdf_extract, hkdf_expand, hkdf, hkdf_extract over pieces, hkdf_expand over pieces, hkdf over pieces and pbkdf2 run on backends::hash2 unless the call names another of its backends as its second template argument; blake2b_subkey runs on backends::sodium alone; kbkdf, sskdf and x963kdf have no default backend, and the call names one of its backends as its second template argument; argon2id and scrypt run on backends::sodium unless the call names another of its backends as its only template argument; bcrypt and bcrypt_pbkdf have no default backend, and the call names backends::botan as its only template argument. The families digest_of, hasher, mac and argon2 take a tag of digests, macs or kdfs and a backend, by default the first of backends::hash2, backends::xkcp, backends::blake3 and backends::sodium that has the tag. Primitives only: protocol steps (BIP39, hash160, EIP-55, Nostr ids, NIP-44) are what a domain library builds from these functions; the guide shows them as examples, never as this library's API. Timing: every MAC, key derivation and password hash, and BLAKE2b's and BLAKE3's keyed modes, set DIT (data-independent timing) around each call on 64-bit ARM under Apple's systems, Linux and Windows where the CPU has FEAT_DIT, on every synchronous backend, and leave the thread's DIT as they found it; unkeyed digests and Boost.Hash2's hmac by alias do not, so an HMAC with DIT is mac>. [Section](https://webcpporg.github.io/libs/hash/#hash-backends-dit) - [The guide](https://webcpporg.github.io/libs/hash/): every chapter, example and table - [Choose by use case](https://webcpporg.github.io/libs/hash/#hash-choose): a decision table, need to function, backend and example ## Digests Cryptographic hash functions: a fixed-size fingerprint of any data, for integrity, content addressing, identifiers and signatures. [Digests](https://webcpporg.github.io/libs/hash/#hash-digests) - webcpp::hash::md5_128 (, RFC 1321): MD5, a 128-bit digest, broken: kept to read existing data and protocols. Status: broken. Choose it: Only to read or check data that already uses it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-legacy) - webcpp::hash::sha1_160 (, RFC 3174, FIPS 180-4): SHA-1, a 160-bit digest, broken: kept to read existing data and protocols. Status: broken. Choose it: Only to read or check data that already uses it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-legacy) - webcpp::hash::sha2_224 (, FIPS 180-4): SHA-224, SHA-256 cut to 224 bits. Status: recommended. Choose it: When a standard asks for it; otherwise SHA-256. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sha2) - webcpp::hash::sha2_256 (, FIPS 180-4): SHA-256, the most widely used 256-bit digest. Status: recommended. Choose it: The default digest: interoperable everywhere, in every browser, fast with hardware support. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sha2) - webcpp::hash::sha2_384 (, FIPS 180-4): SHA-384, SHA-512 cut to 384 bits, immune to length extension. Status: recommended. Choose it: When a standard asks for 192-bit strength, or a digest that resists length extension within SHA-2. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sha2) - webcpp::hash::sha2_512 (, FIPS 180-4): SHA-512, a 512-bit digest, faster than SHA-256 on 64-bit machines without SHA hardware. Status: recommended. Choose it: When a standard asks for it, or for a 512-bit digest. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sha2) - webcpp::hash::sha2_512_224 (, FIPS 180-4): SHA-512/224, SHA-512 with other initial values cut to 224 bits. Status: recommended. Choose it: When a standard asks for it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sha2) - webcpp::hash::sha2_512_256 (, FIPS 180-4): SHA-512/256, SHA-512 with other initial values cut to 256 bits, immune to length extension. Status: recommended. Choose it: A 256-bit SHA-2 digest that resists length extension, fast on 64-bit machines. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sha2) - webcpp::hash::digests::md5 (, RFC 1321): MD5, a 128-bit digest, broken: kept to read existing data and protocols, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: broken. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; md5_128 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::sha1 (, RFC 3174, FIPS 180-4): SHA-1, a 160-bit digest, broken: kept to read existing data and protocols, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: broken. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; sha1_160 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten), webcrypto, asynchronous family only (/webcpp/asio//asio; emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::sha2_224 (, FIPS 180-4): SHA-224, SHA-256 cut to 224 bits, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; sha2_224 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::sha2_256 (, FIPS 180-4): SHA-256, the most widely used 256-bit digest, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; sha2_256 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten), webcrypto, asynchronous family only (/webcpp/asio//asio; emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::sha2_384 (, FIPS 180-4): SHA-384, SHA-512 cut to 384 bits, immune to length extension, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; sha2_384 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten), webcrypto, asynchronous family only (/webcpp/asio//asio; emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::sha2_512 (, FIPS 180-4): SHA-512, a 512-bit digest, faster than SHA-256 on 64-bit machines without SHA hardware, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; sha2_512 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten), webcrypto, asynchronous family only (/webcpp/asio//asio; emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::sha2_512_224 (, FIPS 180-4): SHA-512/224, SHA-512 with other initial values cut to 224 bits, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; sha2_512_224 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::sha2_512_256 (, FIPS 180-4): SHA-512/256, SHA-512 with other initial values cut to 256 bits, immune to length extension, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; sha2_512_256 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::md5_sha1 (, RFC 2246): MD5-SHA1, TLS 1.0's 36-byte digest: MD5 of the data followed by SHA-1 of it, as the tag of digest_of and hasher, on backends::bearssl or backends::openssl named in the call (it has no default). Status: legacy. Choose it: Only to read or check TLS 1.0 and 1.1 data, naming backends::bearssl or backends::openssl; never for anything new: SHA-256 instead. Backends: bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3). [Section](https://webcpporg.github.io/libs/hash/#hash-md5-sha1) - webcpp::hash::sha3_224 (, FIPS 202): SHA3-224, the SHA-3 standard's 224-bit digest. Status: recommended. Choose it: When a standard asks for it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sha3) - webcpp::hash::sha3_256 (, FIPS 202): SHA3-256, the SHA-3 standard's 256-bit digest, a design unrelated to SHA-2. Status: recommended. Choose it: A standard 256-bit digest that is not SHA-2, immune to length extension. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sha3) - webcpp::hash::sha3_384 (, FIPS 202): SHA3-384, the SHA-3 standard's 384-bit digest. Status: recommended. Choose it: When a standard asks for it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sha3) - webcpp::hash::sha3_512 (, FIPS 202): SHA3-512, the SHA-3 standard's 512-bit digest. Status: recommended. Choose it: When a standard asks for it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sha3) - webcpp::hash::shake_128 (, FIPS 202): SHAKE128, an extendable-output function: as many bytes as the caller takes, 128-bit security at most. Status: recommended. Choose it: To draw a long stream of bytes from one input, at 128-bit security. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sha3) - webcpp::hash::shake_256 (, FIPS 202): SHAKE256, an extendable-output function: as many bytes as the caller takes, 256-bit security at most. Status: recommended. Choose it: To draw a long stream of bytes from one input, at 256-bit security. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sha3) - webcpp::hash::digests::sha3_224 (, FIPS 202): SHA3-224, the SHA-3 standard's 224-bit digest, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; sha3_224 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::sha3_256 (, FIPS 202): SHA3-256, the SHA-3 standard's 256-bit digest, a design unrelated to SHA-2, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; sha3_256 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::sha3_384 (, FIPS 202): SHA3-384, the SHA-3 standard's 384-bit digest, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; sha3_384 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::sha3_512 (, FIPS 202): SHA3-512, the SHA-3 standard's 512-bit digest, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; sha3_512 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::shake_128 (, FIPS 202): SHAKE128, an extendable-output function: as many bytes as the caller takes, 128-bit security at most, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; shake_128 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::shake_256 (, FIPS 202): SHAKE256, an extendable-output function: as many bytes as the caller takes, 256-bit security at most, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; shake_256 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::turboshake_128 (, RFC 9861): TurboSHAKE128 (RFC 9861), an extendable-output function: SHAKE128's sponge with 12 rounds of the Keccak-p permutation instead of 24, about twice as fast, and a domain byte that makes each use its own function, as the tag of digest_of and hasher: one call, or pieces with one final result. Status: recommended. Choose it: For an extendable output faster than SHAKE128 with the same security claim, or for several functions from one primitive told apart by the domain byte; shake_128 where a standard names SHAKE. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-turboshake) - webcpp::hash::digests::turboshake_256 (, RFC 9861): TurboSHAKE256 (RFC 9861), an extendable-output function: SHAKE256's sponge with 12 rounds of the Keccak-p permutation instead of 24, about twice as fast, and a domain byte that makes each use its own function, as the tag of digest_of and hasher: one call, or pieces with one final result. Status: recommended. Choose it: For an extendable output faster than SHAKE256 with the same security claim, or for several functions from one primitive told apart by the domain byte; shake_256 where a standard names SHAKE. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-turboshake) - webcpp::hash::keccak_256 (, Keccak (the SHA-3 submission's padding), as Ethereum uses it): Keccak-256 with the original padding, Ethereum's hash; not SHA3-256. Status: recommended. Choose it: For Ethereum and every format that names Keccak-256; never in place of SHA3-256. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-keccak) - webcpp::hash::digests::keccak_224 (, Keccak (the SHA-3 submission's padding)): Keccak-224 with the original padding, the SHA-3 submission's 224-bit hash; not SHA3-224, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: legacy. Choose it: Only where a format names Keccak-224, the padding before FIPS 202; SHA3-224 for anything new. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-keccak) - webcpp::hash::digests::keccak_256 (, Keccak (the SHA-3 submission's padding), as Ethereum uses it): Keccak-256 with the original padding, Ethereum's hash; not SHA3-256, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; keccak_256 itself for hash_append and Boost.Hash2's other functions. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::keccak_384 (, Keccak (the SHA-3 submission's padding)): Keccak-384 with the original padding, the SHA-3 submission's 384-bit hash; not SHA3-384, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: legacy. Choose it: Only where a format names Keccak-384, the padding before FIPS 202; SHA3-384 for anything new. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-keccak) - webcpp::hash::digests::keccak_512 (, Keccak (the SHA-3 submission's padding)): Keccak-512 with the original padding, the SHA-3 submission's 512-bit hash; not SHA3-512, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: legacy. Choose it: Only where a format names Keccak-512, the padding before FIPS 202; SHA3-512 for anything new. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-keccak) - webcpp::hash::digests::cshake_128 (, NIST SP 800-185, section 3): cSHAKE128, SHAKE128 with a function name and a customisation string that separate its uses, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: When two uses of one hash must never give the same output for the same input: each takes its own customisation string. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sp800-185) - webcpp::hash::digests::cshake_256 (, NIST SP 800-185, section 3): cSHAKE256, SHAKE256 with a function name and a customisation string that separate its uses, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: As cSHAKE128, where a format asks for 256-bit security. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sp800-185) - webcpp::hash::digests::tuplehash_128 (, NIST SP 800-185, section 5): TupleHash128, the hash of a tuple of byte strings in which the bounds between the strings count, as the tag of digest_of (a tuple of one string) and hasher (one update per string). Status: recommended. Choose it: To hash several fields together without an encoding of your own: ("ab", "c") and ("a", "bc") never collide, as a plain concatenation does. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sp800-185) - webcpp::hash::digests::tuplehash_256 (, NIST SP 800-185, section 5): TupleHash256, the hash of a tuple of byte strings in which the bounds between the strings count, as the tag of digest_of (a tuple of one string) and hasher (one update per string). Status: recommended. Choose it: As TupleHash128, where a format asks for 256-bit security. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sp800-185) - webcpp::hash::digests::parallelhash_128 (, NIST SP 800-185, section 6): ParallelHash128, a hash of long inputs cut in blocks of B bytes that are hashed independently, as the tag of digest_of and hasher; the block size is part of the function. Status: recommended. Choose it: Where a format names ParallelHash and its block size; for a fast hash of large files without such a format, BLAKE3 or KT128. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sp800-185) - webcpp::hash::digests::parallelhash_256 (, NIST SP 800-185, section 6): ParallelHash256, a hash of long inputs cut in blocks of B bytes that are hashed independently, as the tag of digest_of and hasher; the block size is part of the function. Status: recommended. Choose it: As ParallelHash128, where a format asks for 256-bit security. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sp800-185) - webcpp::hash::digests::kt128 (, RFC 9861): KT128 (KangarooTwelve), an extendable-output tree hash over TurboSHAKE128 that cuts long inputs in chunks of 8,192 bytes, with a customisation string, as the tag of digest_of and hasher. Status: recommended. Choose it: For a fast hash of large files or a hash with an application's customisation string, where no format names SHA-2 or SHA-3; BLAKE3 is the other fast choice. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-kangarootwelve) - webcpp::hash::digests::kt256 (, RFC 9861): KT256 (KangarooTwelve), an extendable-output tree hash over TurboSHAKE256 that cuts long inputs in chunks of 8,192 bytes, with a customisation string, as the tag of digest_of and hasher. Status: recommended. Choose it: As KT128, where a format asks for 256-bit security. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-kangarootwelve) - webcpp::hash::blake2b_512 (, RFC 7693): BLAKE2b, a 512-bit digest faster than SHA-2 in software, with a key of up to 64 bytes. Status: recommended. Choose it: A fast software digest or keyed hash where SHA-2 has no hardware support. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-blake2) - webcpp::hash::blake2s_256 (, RFC 7693): BLAKE2s, a 256-bit digest for 32-bit and small machines, with a key of up to 32 bytes. Status: recommended. Choose it: For WireGuard-style protocols and 32-bit targets. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-blake2) - webcpp::hash::digests::blake2b (, RFC 7693): BLAKE2b (RFC 7693), a digest of 1 to 64 bytes faster than SHA-2 in software, with an optional key, salt and personalisation, as the tag of digest_of and hasher: one call, or pieces with one final result. Status: recommended. Choose it: For BLAKE2b of a length other than 64 bytes, keyed, salted or personalised (a format that names BLAKE2b-256 or a personalisation string), or to hash in pieces with one result; blake2b_512 itself for hash_append. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-blake2b-options) - webcpp::hash::digests::blake2s_256 (, RFC 7693): BLAKE2s, a 256-bit digest for 32-bit and small machines, with a key of up to 32 bytes, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; blake2s_256 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::blake3 (, the BLAKE3 specification (hash, keyed hash, derive_key, extendable output)): BLAKE3, a very fast 256-bit digest with keyed hashing, key derivation and extendable output in one design. Status: recommended. Choose it: Large data verified in parts, content addressing, and key derivation from a context string. Backends: blake3 (/third_party//blake3; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-blake3) - webcpp::hash::digests::blake3 (, the BLAKE3 specification (hash, keyed hash, derive_key, extendable output)): BLAKE3, a very fast 256-bit digest with keyed hashing, key derivation and extendable output in one design, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: recommended. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; blake3 itself for hash_append and Boost.Hash2's other functions. Backends: blake3 (/third_party//blake3; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::ripemd_128 (, RIPEMD-128 (Dobbertin, Bosselaers, Preneel)): RIPEMD-128, a 128-bit legacy digest. Status: legacy. Choose it: Only to read existing data. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-legacy) - webcpp::hash::ripemd_160 (, RIPEMD-160 (Dobbertin, Bosselaers, Preneel)): RIPEMD-160, a 160-bit legacy digest, kept for Bitcoin's hash160. Status: legacy. Choose it: For Bitcoin's hash160; never in a new design. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-legacy) - webcpp::hash::digests::ripemd_160 (, RIPEMD-160 (Dobbertin, Bosselaers, Preneel)): RIPEMD-160, a 160-bit legacy digest, kept for Bitcoin's hash160, as the tag of digest_of and hasher: one call, or pieces with one final result, on any backend that has it. Status: legacy. Choose it: To name the backend in the call, or to hash in pieces with a result that cannot be taken twice; ripemd_160 itself for hash_append and Boost.Hash2's other functions. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-digest-family) - webcpp::hash::digests::sm3 (, GB/T 32905-2016 (ISO/IEC 10118-3:2018)): SM3, China's national 256-bit digest (GB/T 32905-2016, also ISO/IEC 10118-3), as the tag of digest_of and hasher, on a backend the call names (it has no default). Status: recommended. Choose it: Where a Chinese standard or a regulator requires it (SM2 signatures, the ShangMi suites of TLS 1.3), naming backends::openssl or backends::botan; SHA-256 everywhere else. Backends: openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sm3) - webcpp::hash::digests::streebog_256 (, GOST R 34.11-2012 (RFC 6986)): Streebog-256, Russia's national 256-bit digest (GOST R 34.11-2012, RFC 6986), as the tag of digest_of and hasher, on a backend the call names (it has no default). Status: legacy. Choose it: Only where a Russian standard requires GOST R 34.11-2012, naming backends::botan; SHA-256 everywhere else. Backends: botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-streebog) - webcpp::hash::digests::streebog_512 (, GOST R 34.11-2012 (RFC 6986)): Streebog-512, Russia's national 512-bit digest (GOST R 34.11-2012, RFC 6986), as the tag of digest_of and hasher, on a backend the call names (it has no default). Status: legacy. Choose it: Only where a Russian standard requires GOST R 34.11-2012, naming backends::botan; SHA-512 everywhere else. Backends: botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-streebog) - webcpp::hash::digests::whirlpool (, ISO/IEC 10118-3 (Whirlpool, Barreto and Rijmen)): Whirlpool, a 512-bit digest of ISO/IEC 10118-3 and NESSIE, as the tag of digest_of and hasher, on a backend the call names (it has no default). Status: legacy. Choose it: Only to read what a format hashed with it, naming backends::botan; SHA-512 or SHA3-512 everywhere else. Backends: botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-whirlpool) - webcpp::hash::digests::skein_512 (, The Skein Hash Function Family, version 1.3): Skein-512 with a 512-bit digest (Skein 1.3, a finalist of the SHA-3 competition), as the tag of digest_of and hasher, on a backend the call names (it has no default). Status: legacy. Choose it: Only to read what a format hashed with it, naming backends::botan; SHA3-512 or BLAKE2b everywhere else. Backends: botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-skein) ## Message authentication Keyed hashes: a tag that only the holder of a secret key can compute, so that a receiver knows a message is genuine; and SipHash for hash tables. [Message authentication](https://webcpporg.github.io/libs/hash/#hash-macs) - webcpp::hash::siphash_32 (, HalfSipHash-2-4 (Aumasson)): HalfSipHash-2-4, a keyed 32-bit hash for hash tables, with an 8-byte key. Status: recommended. Choose it: Hash tables on 32-bit targets whose keys an adversary chooses. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-siphash) - webcpp::hash::siphash_64 (, SipHash-2-4 (Aumasson, Bernstein)): SipHash-2-4, a keyed 64-bit hash for hash tables keyed by untrusted input, with a 16-byte key. Status: recommended. Choose it: Every hash table, set or Bloom filter whose keys come from the network or another user. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-siphash) - webcpp::hash::macs::siphash_2_4 (, SipHash-2-4 (Aumasson, Bernstein)): SipHash-2-4, a keyed 64-bit hash with a 16-byte key, as the tag of mac: the tag of a message under a key in one call, on any backend that has it. Status: recommended. Choose it: To compute it in one call, on a backend named in the call; siphash_64 itself for hash_append and a hash table's hasher. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::siphash_2_4x (, SipHash-2-4 with a 128-bit output (Aumasson, Bernstein; libsodium's siphashx24)): SipHash-2-4 with a 16-byte output and a 16-byte key, libsodium's crypto_shorthash_siphashx24, as the tag of mac: the tag of a message under a key in one call. Status: recommended. Choose it: For a 128-bit SipHash, as a libsodium program computes it: a large table, a filter or an identifier keyed against flooding; siphash_2_4 for 64 bits. Backends: sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3). [Section](https://webcpporg.github.io/libs/hash/#hash-siphash-sodium) - webcpp::hash::macs::kmac_128 (, NIST SP 800-185, section 4): KMAC128, the MAC built on cSHAKE128 with a key and a customisation string, as the tag of mac: the tag of a message under a key in one call, fixed-length or XOF form. Status: recommended. Choose it: Where a standard or a format names KMAC; HMAC-SHA-256 elsewhere, which every platform has. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-kmac) - webcpp::hash::macs::kmac_256 (, NIST SP 800-185, section 4): KMAC256, the MAC built on cSHAKE256 with a key and a customisation string, as the tag of mac: the tag of a message under a key in one call, fixed-length or XOF form. Status: recommended. Choose it: As KMAC128, where a format asks for 256-bit security. Backends: xkcp (/third_party//xkcp; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-kmac) - webcpp::hash::macs::blake2b_mac (, RFC 7693, keyed (section 2.5)): BLAKE2b keyed with a key of 1 to 64 bytes (RFC 7693), as the tag of mac: the tag of a message under a key in one call, on any backend that has it. Status: recommended. Choose it: A fast keyed tag on 64-bit machines, of any size from 1 to 64 bytes; HMAC-SHA-256 where a format or WebCrypto must agree. Backends: sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-blake2b-mac-sodium) - webcpp::hash::macs::blake2s_mac (, RFC 7693, keyed (section 2.5)): BLAKE2s keyed with a key of 1 to 32 bytes (RFC 7693), as the tag of mac: the tag of a message under a key in one call, on any backend that has it. Status: recommended. Choose it: A fast keyed tag on 32-bit and small machines, without HMAC's two passes. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::hmac (, RFC 2104): hmac, HMAC over any Boost.Hash2 hash. Status: recommended. Choose it: HMAC over a hash that has no alias of its own. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_md5_128 (, RFC 2104): HMAC over MD5, legacy. Status: legacy. Choose it: Only for an existing protocol. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_sha1_160 (, RFC 2104): HMAC over SHA-1, legacy. Status: legacy. Choose it: Only for an existing protocol, such as authenticator-app codes. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_sha2_224 (, RFC 2104): HMAC over SHA-224. Status: recommended. Choose it: When a standard asks for it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_sha2_256 (, RFC 2104): HMAC over SHA-256, the default MAC. Status: recommended. Choose it: The default MAC: interoperable, in every browser. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_sha2_384 (, RFC 2104): HMAC over SHA-384. Status: recommended. Choose it: When a standard asks for it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_sha2_512 (, RFC 2104): HMAC over SHA-512. Status: recommended. Choose it: When a standard asks for it, or for a 512-bit tag. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_sha2_512_224 (, RFC 2104): HMAC over SHA-512/224. Status: recommended. Choose it: When a standard asks for it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_sha2_512_256 (, RFC 2104): HMAC over SHA-512/256. Status: recommended. Choose it: When a standard asks for it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_sha3_224 (, RFC 2104): HMAC over SHA3-224. Status: recommended. Choose it: When a standard asks for it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_sha3_256 (, RFC 2104): HMAC over SHA3-256. Status: recommended. Choose it: When a standard asks for it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_sha3_384 (, RFC 2104): HMAC over SHA3-384. Status: recommended. Choose it: When a standard asks for it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_sha3_512 (, RFC 2104): HMAC over SHA3-512. Status: recommended. Choose it: When a standard asks for it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_ripemd_128 (, RFC 2104): HMAC over RIPEMD-128, legacy. Status: legacy. Choose it: Only for an existing protocol. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_ripemd_160 (, RFC 2104): HMAC over RIPEMD-160, legacy. Status: legacy. Choose it: Only for an existing protocol. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_blake2b_512 (, RFC 2104): HMAC over BLAKE2b; a keyed BLAKE2b does the same job faster. Status: recommended. Choose it: When a protocol names HMAC-BLAKE2b; otherwise a keyed blake2b_512. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::hmac_blake2s_256 (, RFC 2104): HMAC over BLAKE2s. Status: recommended. Choose it: For WireGuard-style protocols. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over MD5, legacy, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on any backend that has it. Status: legacy. Choose it: To compute a tag in one call, on a backend named in the call; hmac_md5_128 itself to feed the message in pieces. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over SHA-1, legacy, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on any backend that has it. Status: legacy. Choose it: To compute a tag in one call, on a backend named in the call; hmac_sha1_160 itself to feed the message in pieces. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten), webcrypto, asynchronous family only (/webcpp/asio//asio; emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over SHA-224, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on any backend that has it. Status: recommended. Choose it: To compute a tag in one call, on a backend named in the call; hmac_sha2_224 itself to feed the message in pieces. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over SHA-256, the default MAC, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on any backend that has it. Status: recommended. Choose it: To compute a tag in one call, on a backend named in the call; hmac_sha2_256 itself to feed the message in pieces. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten), webcrypto, asynchronous family only (/webcpp/asio//asio; emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over SHA-384, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on any backend that has it. Status: recommended. Choose it: To compute a tag in one call, on a backend named in the call; hmac_sha2_384 itself to feed the message in pieces. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten), webcrypto, asynchronous family only (/webcpp/asio//asio; emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over SHA-512, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on any backend that has it. Status: recommended. Choose it: To compute a tag in one call, on a backend named in the call; hmac_sha2_512 itself to feed the message in pieces. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten), webcrypto, asynchronous family only (/webcpp/asio//asio; emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over SHA-512/224, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on any backend that has it. Status: recommended. Choose it: To compute a tag in one call, on a backend named in the call; hmac_sha2_512_224 itself to feed the message in pieces. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over SHA-512/256, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on any backend that has it. Status: recommended. Choose it: To compute a tag in one call, on a backend named in the call; hmac_sha2_512_256 itself to feed the message in pieces. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over SHA3-224, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on any backend that has it. Status: recommended. Choose it: To compute a tag in one call, on a backend named in the call; hmac_sha3_224 itself to feed the message in pieces. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over SHA3-256, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on any backend that has it. Status: recommended. Choose it: To compute a tag in one call, on a backend named in the call; hmac_sha3_256 itself to feed the message in pieces. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over SHA3-384, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on any backend that has it. Status: recommended. Choose it: To compute a tag in one call, on a backend named in the call; hmac_sha3_384 itself to feed the message in pieces. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over SHA3-512, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on any backend that has it. Status: recommended. Choose it: To compute a tag in one call, on a backend named in the call; hmac_sha3_512 itself to feed the message in pieces. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over RIPEMD-160, legacy, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on any backend that has it. Status: legacy. Choose it: To compute a tag in one call, on a backend named in the call; hmac_ripemd_160 itself to feed the message in pieces. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over BLAKE2b; a keyed BLAKE2b does the same job faster, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on any backend that has it. Status: recommended. Choose it: To compute a tag in one call, on a backend named in the call; hmac_blake2b_512 itself to feed the message in pieces. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over BLAKE2s, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on any backend that has it. Status: recommended. Choose it: To compute a tag in one call, on a backend named in the call; hmac_blake2s_256 itself to feed the message in pieces. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-mac-family) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over Keccak-224 with the original padding, not SHA3-224, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on a backend the call names (it has no default). Status: legacy. Choose it: Only where a format names HMAC over Keccak-224; HMAC over SHA3-224 for anything new. Backends: openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-macs-openssl) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over Keccak-256 with the original padding, not SHA3-256, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on a backend the call names (it has no default). Status: legacy. Choose it: Only where a format names HMAC over Keccak-256; HMAC over SHA3-256 for anything new. Backends: openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-macs-openssl) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over Keccak-384 with the original padding, not SHA3-384, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on a backend the call names (it has no default). Status: legacy. Choose it: Only where a format names HMAC over Keccak-384; HMAC over SHA3-384 for anything new. Backends: openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-macs-openssl) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over Keccak-512 with the original padding, not SHA3-512, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on a backend the call names (it has no default). Status: legacy. Choose it: Only where a format names HMAC over Keccak-512; HMAC over SHA3-512 for anything new. Backends: openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-macs-openssl) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over SM3, China's national 256-bit digest, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on a backend the call names (it has no default). Status: recommended. Choose it: Where a Chinese standard or a regulator requires SM3, naming backends::openssl or backends::botan; HMAC-SHA-256 everywhere else. Backends: openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-macs-openssl) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over Streebog-256 (HMAC_GOSTR3411_2012_256, RFC 7836), as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on a backend the call names (it has no default). Status: legacy. Choose it: Only where a Russian standard requires it, naming backends::botan; HMAC-SHA-256 everywhere else. Backends: botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-macs-botan) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over Streebog-512 (HMAC_GOSTR3411_2012_512, RFC 7836), as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on a backend the call names (it has no default). Status: legacy. Choose it: Only where a Russian standard requires it, naming backends::botan; HMAC-SHA-512 everywhere else. Backends: botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-macs-botan) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over Whirlpool, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on a backend the call names (it has no default). Status: legacy. Choose it: Only where a format names HMAC over Whirlpool, naming backends::botan; HMAC-SHA-512 everywhere else. Backends: botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-macs-botan) - webcpp::hash::macs::hmac (, RFC 2104): HMAC over Skein-512, as the tag of mac: the tag of a message under a key in one call, cut to 10 bytes or more if needed, on a backend the call names (it has no default). Status: legacy. Choose it: Only where a format names HMAC over Skein-512, naming backends::botan; HMAC-SHA-512 everywhere else. Backends: botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-macs-botan) ## Key derivation HKDF, PBKDF2 and BLAKE2b subkeys: keys from a shared secret or a master key (HKDF, libsodium's crypto_kdf), or from a password where a standard demands PBKDF2. [Key derivation](https://webcpporg.github.io/libs/hash/#hash-kdfs) - webcpp::hash::hkdf_extract (, RFC 5869): HKDF-Extract: a uniform pseudorandom key from a secret that is not uniform, such as a Diffie-Hellman result. Status: recommended. Choose it: When a protocol names the extract step alone. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten), webcrypto, asynchronous family only (/webcpp/asio//asio; emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hkdf) - webcpp::hash::hkdf_expand (, RFC 5869): HKDF-Expand: many keys, each for one purpose, from one pseudorandom key. Status: recommended. Choose it: Keys from a key that is already uniform (a master key), one per application info label. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten), webcrypto, asynchronous family only (/webcpp/asio//asio; emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hkdf) - webcpp::hash::hkdf (, RFC 5869): HKDF, extract then expand: keys from a shared secret, each separated by its application info label. Status: recommended. Choose it: The default way to turn one secret into several keys. Never for passwords. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten), webcrypto, asynchronous family only (/webcpp/asio//asio; emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hkdf) - webcpp::hash::hkdf_extract over pieces (, RFC 5869): hkdf_extract with its input_key_material as byte_pieces, read one after another as if concatenated, with no cap. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten), webcrypto, asynchronous family only (/webcpp/asio//asio; emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hkdf) - webcpp::hash::hkdf_expand over pieces (, RFC 5869): hkdf_expand with its application_info as byte_pieces, read one after another as if concatenated, with no cap. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten), webcrypto, asynchronous family only (/webcpp/asio//asio; emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hkdf) - webcpp::hash::hkdf over pieces (, RFC 5869): hkdf with its input_key_material and application_info as byte_pieces, read one after another as if concatenated, with no cap. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), bearssl (/third_party//bearssl; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten), webcrypto, asynchronous family only (/webcpp/asio//asio; emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-hkdf) - webcpp::hash::pbkdf2 (, RFC 8018): PBKDF2: a key from a password by many iterations of an hmac; not memory-hard. Status: where a standard names it. Choose it: When a standard or FIPS 140 demands it; otherwise Argon2id for passwords. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten), webcrypto, asynchronous family only (/webcpp/asio//asio; emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-pbkdf2) - webcpp::hash::blake2b_subkey (, libsodium's crypto_kdf: keyed BLAKE2b (RFC 7693) with the subkey's id as the salt and the context as the personalisation): BLAKE2b subkeys, libsodium's crypto_kdf: many keys of 16 to 64 bytes from one 32-byte master key, each named by a 64-bit id and an 8-byte context. Status: recommended. Choose it: To derive the keys a libsodium program derives from the same master key, or keys numbered by id from one random master key; hkdf for a secret that is not uniformly random. Backends: sodium (/third_party//sodium; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-blake2b-subkey) - webcpp::hash::kbkdf (, NIST SP 800-108r1, counter mode over HMAC): KBKDF, NIST SP 800-108's key derivation in counter mode over HMAC: keys from a key-derivation key, a label and a context. Status: recommended. Choose it: When a standard, a protocol or a smart card names SP 800-108's counter mode; hkdf for a new design. Backends: openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-kbkdf) - webcpp::hash::sskdf (, NIST SP 800-56C Rev. 2, one-step KDF over a hash function (SHA-1, SHA-2, SHA-3)): The one-step KDF of NIST SP 800-56C over a hash (the Concat KDF): keys from a key-agreement's shared secret and its fixed info. Status: recommended. Choose it: To derive the key JOSE's ECDH-ES, PKINIT or another SP 800-56C protocol derives; hkdf for a new design. Backends: openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-sskdf) - webcpp::hash::x963kdf (, ANSI X9.63-2011 and SEC 1 v2, over SHA-1, SHA-224, SHA-256, SHA-384 or SHA-512 (SEC 1 v2, section 3.5)): The KDF of ANSI X9.63 (SEC 1): keys from an elliptic-curve shared secret and shared info, the counter after the secret. Status: recommended. Choose it: To derive the keys ECIES or a smart card's key agreement derives by ANSI X9.63; hkdf for a new design. Backends: openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-x963kdf) ## Password hashing Argon2id and scrypt: slow, memory-hard functions that make every guess of a stolen password database expensive. [Password hashing](https://webcpporg.github.io/libs/hash/#hash-password-hashing) - webcpp::hash::argon2id (, RFC 9106, one lane): Argon2id: the recommended password hash, memory-hard, winner of the Password Hashing Competition. Status: recommended. Choose it: Storing passwords and deriving keys from them. Backends: sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-argon2id) - webcpp::hash::kdfs::argon2d (, RFC 9106, every parameter): Argon2d with every parameter of RFC 9106, the tag of argon2: memory accesses that depend on the password, on a backend the call names (it has no default). Status: where no attacker shares the machine. Choose it: Never for passwords; only where a format names Argon2d and no attacker shares the machine. Backends: openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-argon2-family) - webcpp::hash::kdfs::argon2i (, RFC 9106, every parameter): Argon2i (RFC 9106), Argon2's variant whose memory access does not depend on the password, as the tag of argon2: the passes, the memory, the lanes, a secret and associated data, on any backend that has them. Status: legacy. Choose it: Only to check tags a system already stored with Argon2i; Argon2id for anything new. Backends: sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-argon2-family) - webcpp::hash::kdfs::argon2id (, RFC 9106, every parameter): Argon2id (RFC 9106) as the tag of argon2: the passes, the memory in KiB, the lanes, a secret (a pepper) and associated data, on any backend that has them; on libsodium the same tag as the function argon2id. Status: recommended. Choose it: Storing passwords and deriving keys from them where a parameter beyond the function argon2id's is needed (lanes, a pepper, associated data); argon2id otherwise. Backends: sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-argon2-family) - webcpp::hash::scrypt (, RFC 7914): scrypt: a memory-hard password hash, older than Argon2id. Status: recommended. Choose it: When a format demands scrypt; otherwise Argon2id. Backends: sodium (/third_party//sodium; native, wasip2, wasip3, emscripten), openssl (/webcpp/hash//openssl; native, wasip2, wasip3), botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-scrypt) - webcpp::hash::bcrypt (, Provos and Mazieres, A Future-Adaptable Password Scheme (USENIX 1999), as OpenBSD's bcrypt(3) writes it): bcrypt: OpenBSD's password hash, the modular crypt string "$2b$" that systems store, on a backend the call names (it has no default). Status: legacy. Choose it: To check or make the bcrypt strings a system already stores; Argon2id for a new design. Backends: botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-bcrypt) - webcpp::hash::bcrypt_pbkdf (, OpenBSD's bcrypt_pbkdf(3), as OpenSSH's private keys use it): bcrypt_pbkdf: OpenBSD's key derivation over bcrypt's hash, which OpenSSH's private key files use, on a backend the call names (it has no default). Status: legacy. Choose it: To read or write OpenSSH's encrypted private keys; Argon2id for a new design. Backends: botan, with exceptions only (/third_party//botan; native, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-bcrypt) ## Hashes that are not cryptographic Fast hashes for hash tables, checksums against accidents and identifiers that no adversary chooses. [Hashes that are not cryptographic](https://webcpporg.github.io/libs/hash/#hash-non-cryptographic) - webcpp::hash::fnv1a_32 (, FNV-1a): FNV-1a with a 32-bit result: tiny and simple, not cryptographic. Status: not cryptographic. Choose it: Small tables and identifiers no adversary chooses. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-non-cryptographic-functions) - webcpp::hash::fnv1a_64 (, FNV-1a): FNV-1a with a 64-bit result: tiny and simple, not cryptographic. Status: not cryptographic. Choose it: Tables and identifiers no adversary chooses. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-non-cryptographic-functions) - webcpp::hash::xxhash_32 (, xxHash32): xxHash32: a very fast 32-bit checksum, not cryptographic. Status: not cryptographic. Choose it: Fast checksums against accidents on 32-bit targets. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-non-cryptographic-functions) - webcpp::hash::xxhash_64 (, XXH64): XXH64: a very fast 64-bit checksum, not cryptographic. Status: not cryptographic. Choose it: Fast checksums against accidents, as Zstandard's. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-non-cryptographic-functions) - webcpp::hash::xxh3_128 (, XXH3): XXH3 with a 128-bit result: a fast checksum, not cryptographic. Status: not cryptographic. Choose it: Checksums and identifiers of large data no adversary chooses. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-non-cryptographic-functions) - webcpp::hash::murmur3_32 (, MurmurHash3): MurmurHash3 x86_32, a fast 32-bit hash, not cryptographic. Status: not cryptographic. Choose it: To match existing data that uses it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-non-cryptographic-functions) - webcpp::hash::murmur3_128 (, MurmurHash3): MurmurHash3 x64_128, a fast 128-bit hash, not cryptographic. Status: not cryptographic. Choose it: To match existing data that uses it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-non-cryptographic-functions) - webcpp::hash::spooky2_128 (, SpookyHash V2): SpookyHash V2, a fast 128-bit hash, not cryptographic. Status: not cryptographic. Choose it: To match existing data that uses it. Backends: hash2 (/webcpp/hash//hash; native, wasip2, wasip3, emscripten). [Section](https://webcpporg.github.io/libs/hash/#hash-non-cryptographic-functions) ## Choose by use case - I need to check that a file or message was not changed by accident or on the way: sha2_256 (or blake3 for large data); backend: none: one backend; example libs/hash/example/sha256.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-sha2) - I need to name content by what it holds (a file-sharing app, a cache, a store of blobs): blake3; backend: link /third_party//blake3; example libs/hash/example/content_address.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-p2p-content) - I need to prove a message comes from someone who holds a shared secret key (an API request, a cookie, a webhook): hmac_sha2_256, checked with webcpp::secure::constant_time_equal; backend: none: one backend; example libs/hash/example/hmac_sha256.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-hmac) - I need to store users' passwords for a login: argon2id with argon2id_interactive or stronger, a random 16-byte salt per user; backend: link /third_party//sodium; example libs/hash/example/password_storage.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-privacy-passwords) - I need to turn a password into an encryption key (a password manager, an encrypted backup): argon2id with argon2id_moderate or argon2id_sensitive, then hkdf for each purpose; backend: link /third_party//sodium; example libs/hash/example/argon2id.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-argon2id) - I need to check or make the bcrypt strings a system already stores, or read and write OpenSSH's encrypted private keys: bcrypt and bcrypt_verify at a cost of 10 or more (bcrypt_pbkdf for OpenSSH's keys); argon2id for a new design; backend: name backends::botan and link /third_party//botan, with exceptions; example libs/hash/example/bcrypt.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-bcrypt) - I need to turn a shared secret (an ECDH result) into keys: hkdf over hmac_sha2_256, one application info label per key; backend: the default; name a backend only to match another program's; example libs/hash/example/hkdf.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-hkdf) - I need to derive the key JOSE's ECDH-ES (a JWE) or another NIST SP 800-56C protocol derives from a shared secret: sskdf over digests::sha2_256, the fixed info as the protocol writes it; backend: name backends::openssl (or backends::botan) and link its library, /webcpp/hash//openssl (or /third_party//botan); example libs/hash/example/sskdf.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-sskdf) - I need to derive the keys of ECIES or of a smart card's key agreement (ANSI X9.63): x963kdf over digests::sha2_256, the shared info as the scheme writes it; backend: name backends::openssl (or backends::botan) and link its library, /webcpp/hash//openssl (or /third_party//botan); example libs/hash/example/x963kdf.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-x963kdf) - I need to derive keys from a key as NIST SP 800-108 or Kerberos does (a label and a context): kbkdf over hmac_sha2_256 with the label and the context; backend: name backends::openssl (or backends::botan) and link its library, /webcpp/hash//openssl (or /third_party//botan); example libs/hash/example/kbkdf.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-kbkdf) - I need to derive many keys from one master key, one per purpose: hkdf_expand (or hkdf) with distinct application info labels, blake2b_subkey (libsodium's crypto_kdf) by id, or blake3::derive_key with a context string; backend: the default; example libs/hash/example/subkeys.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-privacy-subkeys) - I need to build a hash table, set or Bloom filter whose keys come from the network: siphash_64 keyed with 16 random bytes per process; backend: none: one backend; example libs/hash/example/siphash.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-siphash) - I need to build a hash table of my own trusted keys, or a fast checksum: xxh3_128 or fnv1a_64; backend: none: one backend; example libs/hash/example/checksums.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-non-cryptographic-functions) - I need to compute a Bitcoin wallet's BIP39 seed from its words: pbkdf2 over hmac_sha2_512, 2,048 iterations (a domain library's step); backend: the default; example libs/hash/example/bip39_seed.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-crypto-bip39) - I need to compute a Bitcoin address's hash160: ripemd_160 over sha2_256 (a domain library's step); backend: none: one backend; example libs/hash/example/bitcoin_hash160.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-crypto-hash160) - I need to compute an Ethereum address or a Solidity selector: keccak_256 (never sha3_256); backend: link /third_party//xkcp; example libs/hash/example/ethereum_address.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-crypto-ethereum) - I need to compute a Nostr event id: sha2_256 over NIP-01's serialization (a domain library's step); backend: none: one backend; example libs/hash/example/nostr_event_id.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-p2p-nostr) - I need to derive NIP-44's conversation key: hkdf_extract over hmac_sha2_256 with the salt nip44-v2 (a domain library's step); backend: the default; example libs/hash/example/nip44_conversation_key.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-p2p-nip44) - I need to draw a long stream of pseudorandom bytes from a seed: shake_128 or shake_256, or blake3's squeeze; backend: none: one backend; example libs/hash/example/sha3_shake.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-sha3) - I need to build the smallest WebAssembly program: the default backend, backends::hash2, header-only, and link only the libraries the program uses; backend: the default; example libs/hash/example/hkdf_backends.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-default-backend) - I need to run the same code, with the same results, on every target: the default backend, backends::hash2, the same code on every target; backend: the default; example libs/hash/example/hkdf_backends.cpp. [Section](https://webcpporg.github.io/libs/hash/#hash-default-backend) ## Data - doc/capabilities.json: which backend implements each function, on which targets, over which hmacs, and its constant time - doc/capabilities.json also names each function's default backend - doc/measurements.json: each backend's program size per target and its throughput, a reference measured on 2026-11-16 that decides nothing