MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / test_short_hashes

Method test_short_hashes

tests/commoncode/test_hash.py:35–40  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

33 assert h(b"aaa").b64digest() == "fiQN50-x7Qj6CNOAY_amqRRiqBU="
34
35 def test_short_hashes(self):
36 h = get_hasher(32)
37 assert h(b"a").hexdigest() == "0cc175b9"
38 assert h(b"aa").hexdigest() == "4124bc0a"
39 h = get_hasher(64)
40 assert h(b"aa").hexdigest() == "4124bc0a9335c27f"
41
42 def test_sha1_checksum_on_text(self):
43 test_file = self.get_test_loc("hash/dir1/a.txt")

Callers

nothing calls this directly

Calls 3

get_hasherFunction · 0.90
hexdigestMethod · 0.80
hFunction · 0.50

Tested by

no test coverage detected