-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
Using plain strings as input to hash, encryption, etc. functions doesn't work very well for binary data. I have experienced several issues where decoding the data to a string before encrypting it would lose some bytes because they weren't valid in the respective encoding.
I would suggest to
- supply another batch of lazy methods for
GenericHash,SecretBox,AEADand others that take byte arrays as their respective messages directly. They may return either a hex string or a byte array, both are good options, really. - clarify the API regarding what type of string is expected as an input. At the moment, the usage of
Stringas the parameter type is ambiguous as sometimes it means "hex string" and sometimes it means "plain string". Maybe this can be clarified through the parameter name, e.g.plainMessagevshexCipher
Metadata
Metadata
Assignees
Labels
No labels