MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / pad

Function pad

src/hashing/sha1.rs:54–70  ·  view source on GitHub ↗

Pads the message to a multiple of 512 bits. SHA-1 padding appends a single `1` bit, enough `0` bits, and finally the original message length as a 64-bit big-endian integer, such that the total length is congruent to 0 mod 512.

(message: &[u8])

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

sha1Function · 0.85
spongeFunction · 0.85

Calls 2

pushMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected