MCPcopy Create free account
hub / github.com/geekcomputers/Python / padding

Method padding

sha1.py:29–35  ·  view source on GitHub ↗

Pads the input message with zeros so that padded_data has 64 bytes or 512 bits

(self)

Source from the content-addressed store, hash-verified

27 return ((n << b) | (n >> (32 - b))) & 0xFFFFFFFF
28
29 def padding(self):
30 """
31 Pads the input message with zeros so that padded_data has 64 bytes or 512 bits
32 """
33 padding = b"\x80" + b"\x00" * (63 - (len(self.data) + 8) % 64)
34 padded_data = self.data + padding + struct.pack(">Q", 8 * len(self.data))
35 return padded_data
36
37 def split_blocks(self):
38 """

Callers 1

final_hashMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected