コード例 #1
0
ファイル: hashids_test.py プロジェクト: plainspace/h
def test_hashids_decode_one():
    assert hashids.decode_one("foo", "1V91V4") == 1
    assert hashids.decode_one("bar", "E8Rz8D") == 1
    assert hashids.decode_one("foo", "Lgq4nK") == 123
    assert hashids.decode_one("foo", "zvuvt2") is None
コード例 #2
0
ファイル: models.py プロジェクト: dezynetechnologies/h
 def get_by_hashid(cls, hashid):
     """Return the group with the given hashid, or None."""
     return cls.get_by_id(hashids.decode_one('h.groups', hashid))