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

Method test_get_hasher

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

Source from the content-addressed store, hash-verified

27 test_data_dir = os.path.join(os.path.dirname(__file__), "data")
28
29 def test_get_hasher(self):
30 h = get_hasher(160)
31 assert h(b"a").b64digest() == "hvfkN_qlp_zhXR3cuerq6jd2Z7g="
32 assert h(b"aa").b64digest() == "4MkDWJjdUvxlxBRUzsnE0mEb-zc="
33 assert h(b"aaa").b64digest() == "fiQN50-x7Qj6CNOAY_amqRRiqBU="
34
35 def test_short_hashes(self):
36 h = get_hasher(32)

Callers

nothing calls this directly

Calls 3

get_hasherFunction · 0.90
b64digestMethod · 0.80
hFunction · 0.50

Tested by

no test coverage detected