Chromium Code Reviews| Index: lib/crypto/crypto.dart |
| diff --git a/lib/crypto/crypto.dart b/lib/crypto/crypto.dart |
| index f17c0f0e9c9c9d79aae83e3357eca9d592f381ae..ba4f61df7d74d6bc0e6de6c0d547177e49c87dee 100644 |
| --- a/lib/crypto/crypto.dart |
| +++ b/lib/crypto/crypto.dart |
| @@ -4,6 +4,7 @@ |
| #library('crypto'); |
| +#source('crypto_utils.dart'); |
| #source('hmac.dart'); |
| #source('sha_utils.dart'); |
| #source('sha1.dart'); |
| @@ -59,7 +60,6 @@ interface SHA256 extends Hash default _SHA256 { |
| SHA256(); |
| } |
| - |
| /** |
| * Hash-based Message Authentication Code support. |
| * |
| @@ -84,6 +84,18 @@ interface HMAC default _HMAC { |
| List<int> digest(); |
| } |
| +/** |
| + * Utility methods for working with message digests. |
| + */ |
| +class CryptoUtils { |
| + /** |
| + * Convert a message digest which is a list of bytes into a hex |
| + * string. |
| + */ |
| + static String digestToHex(List<int> digest) { |
|
Søren Gjesse
2012/05/07 14:26:34
Shouldn't this just be bytesToHex? This can be use
Mads Ager (google)
2012/05/07 14:34:59
Good point. Done.
|
| + return _CryptoUtils.digestToHex(digest); |
| + } |
| +} |
| /** |
| * HashExceptions are thrown on invalid use of a Hash |