MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / preprocessing

Method preprocessing

hashes/sha256.py:121–124  ·  view source on GitHub ↗
(data: bytes)

Source from the content-addressed store, hash-verified

119
120 @staticmethod
121 def preprocessing(data: bytes) -> bytes:
122 padding = b"\x80" + (b"\x00" * (63 - (len(data) + 8) % 64))
123 big_endian_integer = struct.pack(">Q", (len(data) * 8))
124 return data + padding + big_endian_integer
125
126 def final_hash(self) -> None:
127 # Convert into blocks of 64 bytes

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected