Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(540)

Unified Diff: lib/crypto/crypto_vm.dart

Issue 10456028: Add base 64 encoding to the crypto library utils. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/crypto/crypto_utils.dart ('k') | tests/lib/crypto/base64_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/crypto/crypto_vm.dart
diff --git a/lib/crypto/crypto_vm.dart b/lib/crypto/crypto_vm.dart
index d7f36403a1fb9fd18d0dde88fc937dc333d0811d..32122b28db438118cfbcffe73e308171462e9666 100644
--- a/lib/crypto/crypto_vm.dart
+++ b/lib/crypto/crypto_vm.dart
@@ -102,6 +102,15 @@ class CryptoUtils {
static String bytesToHex(List<int> bytes) {
return _CryptoUtils.bytesToHex(bytes);
}
+
+ /**
+ * Converts a list of bytes (for example a message digest) into a
+ * base64 encoded string optionally broken up in to lines of
+ * [lineLength] chars separated by '\r\n'.
+ */
+ static String bytesToBase64(List<int> bytes, [int lineLength]) {
+ return _CryptoUtils.bytesToBase64(bytes, lineLength);
+ }
}
/**
« no previous file with comments | « lib/crypto/crypto_utils.dart ('k') | tests/lib/crypto/base64_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698