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

Method ror

hashes/sha256.py:190–194  ·  view source on GitHub ↗

Right rotate a given unsigned number by a certain amount of rotations

(self, value: int, rotations: int)

Source from the content-addressed store, hash-verified

188 self.hash = "".join([hex(value)[2:].zfill(8) for value in self.hashes])
189
190 def ror(self, value: int, rotations: int) -> int:
191 """
192 Right rotate a given unsigned number by a certain amount of rotations
193 """
194 return 0xFFFFFFFF & (value << (32 - rotations)) | (value >> rotations)
195
196
197class SHA256HashTest(unittest.TestCase):

Callers 1

final_hashMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected