Short Python alphanumeric hash with minimal collisions

后端 未结 5 1895
隐瞒了意图╮
隐瞒了意图╮ 2020-12-16 09:32

I\'d like to set non-integer primary keys for a table using some kind of hash function. md5() seems to be kind of long (32-characters).

What are some alternative

5条回答
  •  星月不相逢
    2020-12-16 10:19

    Hashids is a library (with Python support) that creates hashes that you can encode/decode very easily.

    http://hashids.org/python/

提交回复
热议问题