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

Method expand_block

hashes/sha1.py:68–76  ·  view source on GitHub ↗

Takes a bytestring-block of length 64, unpacks it to a list of integers and returns a list of 80 integers pafter some bit operations

(self, block)

Source from the content-addressed store, hash-verified

66
67 # @staticmethod
68 def expand_block(self, block):
69 """
70 Takes a bytestring-block of length 64, unpacks it to a list of integers and returns a
71 list of 80 integers pafter some bit operations
72 """
73 w = list(struct.unpack('>16L', block)) + [0] * 64
74 for i in range(16, 80):
75 w[i] = self.rotate((w[i-3] ^ w[i-8] ^ w[i-14] ^ w[i-16]), 1)
76 return w
77
78 def final_hash(self):
79 """

Callers 1

final_hashMethod · 0.95

Calls 1

rotateMethod · 0.95

Tested by

no test coverage detected