Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate_password_hash documentation (or implementation?) tiny bug #12

Open
andreymal opened this issue Jan 10, 2016 · 0 comments
Open

Comments

@andreymal
Copy link

Args:
salt : Random base64 encoded string.

But actually it is not base64 and can be any bytes. It can be checked with example from https://github.com/wg/scrypt README:

$s0$e0801$epIxT/h6HbbwHaehFnh/bw==$7H0vsXlY8UxxyW/BWx/9GuY7jEvGjT71GFd6O4SZND0=
passwd = "secret"

>>> generate_password_hash('secret', 'epIxT/h6HbbwHaehFnh/bw==', buflen=32)
b'bOtJk8AGtmOih+BeAFSpHowvaBXoO7m8+ppmsph4EqQ='  # WRONG
>>> generate_password_hash('secret', b64decode('epIxT/h6HbbwHaehFnh/bw=='), buflen=32)
b'7H0vsXlY8UxxyW/BWx/9GuY7jEvGjT71GFd6O4SZND0='  # CORRECT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant