Module sha

Source

Constantsยง

DIGEST_MAX_INPUT_LEN ๐Ÿ”’
SHA-1, SHA-224, and SHA-256 are limited to an input size of 2^64-1 bits. SHA-384, SHA-512, and SHA-512/256 are limited to an input size of 2^128-1 bits according to the spec. u64 is more than sufficient enough for practical usecases, so we limit the input length to 2^64-1 bits.
SHA1_BLOCK_LEN ๐Ÿ”’
The length of a block for SHA-1, in bytes.
SHA1_OUTPUT_LEN
The length of the output of SHA-1, in bytes.
SHA3_256_BLOCK_LEN ๐Ÿ”’
The length of a block for SHA3-256-based algorithms, in bytes.
SHA3_256_OUTPUT_LEN
The length of the output of SHA3-256 in bytes.
SHA3_384_BLOCK_LEN ๐Ÿ”’
The length of a block for SHA3-384-based algorithms, in bytes.
SHA3_384_OUTPUT_LEN
The length of the output of SHA3-384, in bytes.
SHA3_512_BLOCK_LEN ๐Ÿ”’
The length of a block for SHA3-512-based algorithms, in bytes.
SHA3_512_OUTPUT_LEN
The length of the output of SHA3-512, in bytes.
SHA224_OUTPUT_LEN
The length of the output of SHA-224, in bytes.
SHA256_BLOCK_LEN ๐Ÿ”’
The length of a block for SHA-256-based algorithms, in bytes.
SHA256_OUTPUT_LEN
The length of the output of SHA-256, in bytes.
SHA384_OUTPUT_LEN
The length of the output of SHA-384, in bytes.
SHA512_256_OUTPUT_LEN
The length of the output of SHA-512/256, in bytes.
SHA512_BLOCK_LEN ๐Ÿ”’
The length of a block for SHA-512-based algorithms, in bytes.
SHA512_OUTPUT_LEN
The length of the output of SHA-512, in bytes.

Staticsยง

SHA1_FOR_LEGACY_USE_ONLY
SHA-1 as specified in FIPS 180-4. Deprecated.
SHA3_256
SHA3-256 as specified in FIPS 202.
SHA3_384
SHA3-384 as specified in FIPS 202.
SHA3_512
SHA3-512 as specified in FIPS 202.
SHA224
SHA-224 as specified in FIPS 180-4.
SHA256
SHA-256 as specified in FIPS 180-4.
SHA384
SHA-384 as specified in FIPS 180-4.
SHA512
SHA-512 as specified in FIPS 180-4.
SHA512_256
SHA-512/256 as specified in FIPS 180-4.

Functionsยง

sha1_digest ๐Ÿ”’
sha3_256_digest ๐Ÿ”’
sha3_384_digest ๐Ÿ”’
sha3_512_digest ๐Ÿ”’
sha224_digest ๐Ÿ”’
sha256_digest ๐Ÿ”’
sha384_digest ๐Ÿ”’
sha512_256_digest ๐Ÿ”’
sha512_digest ๐Ÿ”’