MCPcopy Index your code
hub / github.com/python/cpython / get_expected_hash

Method get_expected_hash

Lib/test/test_hash.py:254–264  ·  view source on GitHub ↗
(self, position, length)

Source from the content-addressed store, hash-verified

252 }
253
254 def get_expected_hash(self, position, length):
255 if length < sys.hash_info.cutoff:
256 algorithm = "djba33x"
257 else:
258 algorithm = sys.hash_info.algorithm
259 if sys.byteorder == 'little':
260 platform = 1 if IS_64BIT else 0
261 else:
262 assert(sys.byteorder == 'big')
263 platform = 3 if IS_64BIT else 2
264 return self.known_hashes[algorithm][position][platform]
265
266 def test_null_hash(self):
267 # PYTHONHASHSEED=0 disables the randomized hash

Callers 4

test_null_hashMethod · 0.95
test_fixed_hashMethod · 0.95
test_long_fixed_hashMethod · 0.95
test_ucs2_stringMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected