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

Function getBlock

hashes/md5.py:58–75  ·  view source on GitHub ↗

[summary] Iterator: Returns by each call a list of length 16 with the 32 bit integer blocks. Arguments: bitString {[string]} -- [binary string >= 512]

(bitString)

Source from the content-addressed store, hash-verified

56 return bitString
57
58def getBlock(bitString):
59 """[summary]
60 Iterator:
61 Returns by each call a list of length 16 with the 32 bit
62 integer blocks.
63
64 Arguments:
65 bitString {[string]} -- [binary string >= 512]
66 """
67
68 currPos = 0
69 while currPos < len(bitString):
70 currPart = bitString[currPos:currPos+512]
71 mySplits = []
72 for i in range(16):
73 mySplits.append(int(rearrange(currPart[32*i:32*i+32]),2))
74 yield mySplits
75 currPos += 512
76
77def not32(i):
78 i_str = format(i,'032b')

Callers 1

md5meFunction · 0.85

Calls 1

rearrangeFunction · 0.85

Tested by

no test coverage detected