-
Notifications
You must be signed in to change notification settings - Fork 35
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
Allow Buffer as key
#33
Comments
Looks like the only real technical blocker here would be to change the assertions from e.g.
to something like:
This seems relatively harmless to me but I'd want to get at least another set of eyes from downstream maintainers — e.g. @dougwilson — to make sure this wouldn't introduce any risk. (I'm struggling to find a reason not to change this but perhaps there's code out there that, say, for whatever reason, relies on the current assertion. Maybe a reasonable compromise would be to allow this flexibility in a new major release?) |
Depending on how The code is there (imo) as a guard to provide a useful error message. Not sure what |
Or any other of the allowed types for the
key
parameter:<string> | <Buffer> | <TypedArray> | <DataView> | <KeyObject>
Cryptographically secure keys are usually binary encoded, converting them to strings is not always possible.
The text was updated successfully, but these errors were encountered: