Skip to content

Instantly share code, notes, and snippets.

@bububa
Created February 9, 2013 15:19
Show Gist options
  • Save bububa/4745678 to your computer and use it in GitHub Desktop.
Save bububa/4745678 to your computer and use it in GitHub Desktop.
pwdgen algorithm
base62(base64(sha512(hexstr(md5(encrypt_key+encrypt_salt))+site_id+site_salt)))[0:len]
// base64 -> base62
// 'i' -> "ii"
// '+' -> "ip"
// '/' -> "is"
// '=' -> "ie"
其中encrypt_key是用户输入的加密口令, base62是为了去掉特殊字符.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment