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

CreateHash and others should provide byte variants #26

Open
mitar opened this issue Dec 4, 2023 · 2 comments · May be fixed by #27
Open

CreateHash and others should provide byte variants #26

mitar opened this issue Dec 4, 2023 · 2 comments · May be fixed by #27

Comments

@mitar
Copy link

mitar commented Dec 4, 2023

I have my password already as []byte. It feels to me a bit silly to have to convert it to string just that then CreateHash calls converts it back to []byte again.

Should this package provider byte variants of CreateHash and others? It has been recently tagged 1.0.0 so probably it is too late to change this now in existing functions.

@mitar
Copy link
Author

mitar commented Dec 4, 2023

Oh, that could be done with generics probably in a backwards compatible way. And most of the time Go runtime would just detect the correct type.

@mitar mitar linked a pull request Dec 4, 2023 that will close this issue
@mitar
Copy link
Author

mitar commented Dec 19, 2023

Another issue with string is that strings are immutable, so it is tricky to wipe them from memory. See here for more information.

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

Successfully merging a pull request may close this issue.

1 participant