Hashing (hiding) strings in Python

前端 未结 4 1738
南方客
南方客 2020-12-15 08:14

What I need is to hash a string. It doesn\'t have to be secure because it\'s just going to be a hidden phrase in the text file (it just doesn\'t have to be recognizable for

4条回答
  •  孤街浪徒
    2020-12-15 08:27

    Simply use the hash() built-in function, for example:

    s = 'a string'
    hash(s)
    => -8411828025894108412
    

提交回复
热议问题