You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Therefore, I propose to use a rich object called Digest instead. It would look like this:
interface Digest {
final List<int> bytes;
// TODO operator equals, when implemented
bool operator ==(Digest other);
String toString();
}
I'm attaching a patch with complete implementation (necessary modifications to tests included). Note that if you accept this, it supersedes issue #2839.
Please note that I DON'T really understand crypto, so if you decide to accept this API change, proper crypto review is a good idea :-)
To increase likelihood of getting this applied (or at least considered), I'm attaching a new version of the patch that applies cleanly to current Dart tree.
I intentionally didn't remove the CryptoUtils.bytesToHex function, because it might be useful for other stuff too, not only for digests.
This issue was originally filed by ladicek@gmail.com
In its current shape, the hash and HMAC functions in the crypto library return List<int> as a message digest. This has several deficiencies:
Therefore, I propose to use a rich object called Digest instead. It would look like this:
interface Digest {
final List<int> bytes;
// TODO operator equals, when implemented
bool operator ==(Digest other);
String toString();
}
I'm attaching a patch with complete implementation (necessary modifications to tests included). Note that if you accept this, it supersedes issue #2839.
Please note that I DON'T really understand crypto, so if you decide to accept this API change, proper crypto review is a good idea :-)
Attachment:
0001-represent-message-digest-as-a-rich-object-with-bette.patch (9.72 KB)
The text was updated successfully, but these errors were encountered: