“Alphanumeric” hash - A-Z, 0-9

后端 未结 2 1011
盖世英雄少女心
盖世英雄少女心 2021-02-13 04:39

I\'m looking for a function that will generate an \"alphanumeric hash\". Given a source string, it produces a determinate result string that can contain any letter a-z or digit

2条回答
  •  南方客
    南方客 (楼主)
    2021-02-13 05:42

    If you just use those bits as they are (so that one character only has 16 possibilities), you still have your full 64 bits of entropy. If you're happy with 64 bits of entropy (which it sounds like you are), there's no reason to mind that one character has a restricted range.

    If you have some reason (aesthetics?) to prefer that all of the characters have the full range, then you can drop those 4 bits, but you'll be taking yourself down to 60 bits of entropy. If you would have been happy with 8-character passwords, then it sounds like 60 bits is also plenty.

    So whichever of those is easier should work fine.

提交回复
热议问题