MCPcopy Create free account
hub / github.com/davidaurelio/hashids-python / test_salt

Method test_salt

test/test_hashids.py:35–40  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

33 assert h.encode(99, 25) == '3lKfD'
34
35 def test_salt(self):
36 h = Hashids(salt='Arbitrary string')
37 assert h.encode(683, 94108, 123, 5) == 'QWyf8yboH7KT2'
38 assert h.encode(1, 2, 3) == 'neHrCa'
39 assert h.encode(2, 4, 6) == 'LRCgf2'
40 assert h.encode(99, 25) == 'JOMh1'
41
42 def test_alphabet(self):
43 h = Hashids(alphabet='!"#%&\',-/0123456789:;<=>ABCDEFGHIJKLMNOPQRSTUVWXYZ_`abcdefghijklmnopqrstuvwxyz~&#x27;)

Callers

nothing calls this directly

Calls 2

encodeMethod · 0.95
HashidsClass · 0.90

Tested by

no test coverage detected