MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / padding

Method padding

hashes/sha1.py:53–59  ·  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

51 return ((n << b) | (n >> (32 - b))) & 0xffffffff
52
53 def padding(self):
54 """
55 Pads the input message with zeros so that padded_data has 64 bytes or 512 bits
56 """
57 padding = b'\x80' + b'\x00'*(63 - (len(self.data) + 8) % 64)
58 padded_data = self.data + padding + struct.pack('>Q', 8 * len(self.data))
59 return padded_data
60
61 def split_blocks(self):
62 """

Callers 1

final_hashMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected