`SHA1` hash algorithm. WARNING: The SHA1 algorithm is known to be insecure and should only be used for interoperating with legacy applications. See: - [[ https://eprint.iacr.org/2017/190 ]] - [[ https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf ]] - [[ https://datatracker.ietf.org/doc/html/rfc3174 ]]

Collection Info

View Source
Collection
core
Path
crypto/legacy/sha1
Entries
8

Source Files

Constants

2

BLOCK_SIZE #

Source
BLOCK_SIZE :: 64

BLOCK_SIZE is the SHA1 block size in bytes.

DIGEST_SIZE #

Source
DIGEST_SIZE :: 20

DIGEST_SIZE is the SHA1 digest size in bytes.

Types

1

Procedures

5

clone #

Source
clone :: proc(ctx, other: ^$T) {…}

clone clones the Context other into ctx.

final #

Source
final :: proc(ctx: ^Context, hash: []u8, finalize_clone: bool = false) {…}

final finalizes the Context, writes the digest to hash, and calls reset on the Context. If and only if (⟺) finalize_clone is set, final will work on a copy of the Context, which is useful for for calculating rolling digests.

reset #

Source
reset :: proc(ctx: ^$T) {…}

reset sanitizes the Context. The Context must be re-initialized to be used again.