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

Side by Side Diff: lib/crypto/crypto.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: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | lib/crypto/crypto_utils.dart » ('j') | lib/crypto/crypto_utils.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library('crypto'); 5 #library('crypto');
6 6
7 #source('crypto_utils.dart'); 7 #source('crypto_utils.dart');
8 #source('hash_utils.dart'); 8 #source('hash_utils.dart');
9 #source('hmac.dart'); 9 #source('hmac.dart');
10 #source('md5.dart'); 10 #source('md5.dart');
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 * Utility methods for working with message digests. 99 * Utility methods for working with message digests.
100 */ 100 */
101 class CryptoUtils { 101 class CryptoUtils {
102 /** 102 /**
103 * Convert a list of bytes (for example a message digest) into a hex 103 * Convert a list of bytes (for example a message digest) into a hex
104 * string. 104 * string.
105 */ 105 */
106 static String bytesToHex(List<int> bytes) { 106 static String bytesToHex(List<int> bytes) {
107 return _CryptoUtils.bytesToHex(bytes); 107 return _CryptoUtils.bytesToHex(bytes);
108 } 108 }
109
110 /**
111 * Converts a list of bytes (for example a message digest) into a
112 * base64 encoded string.
113 */
114 static String bytesToBase64(List<int> bytes) {
115 return _CryptoUtils.bytesToBase64(bytes);
116 }
109 } 117 }
110 118
111 /** 119 /**
112 * HashExceptions are thrown on invalid use of a Hash 120 * HashExceptions are thrown on invalid use of a Hash
113 * object. 121 * object.
114 */ 122 */
115 class HashException { 123 class HashException {
116 HashException(String this.message); 124 HashException(String this.message);
117 toString() => "HashException: $message"; 125 toString() => "HashException: $message";
118 String message; 126 String message;
119 } 127 }
120 128
OLDNEW
« no previous file with comments | « no previous file | lib/crypto/crypto_utils.dart » ('j') | lib/crypto/crypto_utils.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698