cryptopasta icon indicating copy to clipboard operation
cryptopasta copied to clipboard

HashPassword naming confuses people

Open gtank opened this issue 8 years ago • 3 comments

gtank avatar Jun 01 '17 21:06 gtank

I recommend NewPasswordHash. Its documentation should state:

  1. This command returns a different hash each call for the same password.
  2. Use CheckPasswordHash to verify a password matches the hash.

stephenmw avatar Jun 01 '17 21:06 stephenmw

Agreed, NewPasswordHash is way better.

gtank avatar Jun 01 '17 21:06 gtank

To avoid breaking compatibility just leave the old name in, calling the new one, and mark it with the godoc deprecated annotation to hide it.

FiloSottile avatar Jun 01 '17 21:06 FiloSottile