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

Side by Side Diff: lib/crypto.dart

Issue 1159093002: Implement a Base64 codec (Closed) Base URL: https://github.com/dart-lang/crypto.git@master
Patch Set: Address review comments Created 5 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
« no previous file with comments | « no previous file | lib/src/base64.dart » ('j') | lib/src/base64.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
Lasse Reichstein Nielsen 2015/05/29 14:15:41 Extra line doesn't belong here.
Alexander Ivanov 2015/06/03 09:14:57 Done.
2 // for details. All rights reserved. Use of this source code is governed by a 3 // 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. 4 // BSD-style license that can be found in the LICENSE file.
4 5
5 /** 6 /**
6 * Cryptographic algorithms, with support for hash functions such as 7 * Cryptographic algorithms, with support for hash functions such as
7 * SHA-1, SHA-256, HMAC, and MD5. 8 * SHA-1, SHA-256, HMAC, and MD5.
8 */ 9 */
9 library crypto; 10 library crypto;
10 11
11 import 'dart:math'; 12 import 'dart:math';
12 import 'dart:typed_data'; 13 import 'dart:typed_data';
14 import 'dart:convert';
13 15
14 part 'src/crypto_utils.dart'; 16 part 'src/crypto_utils.dart';
15 part 'src/hash_utils.dart'; 17 part 'src/hash_utils.dart';
16 part 'src/hmac.dart'; 18 part 'src/hmac.dart';
17 part 'src/md5.dart'; 19 part 'src/md5.dart';
18 part 'src/sha1.dart'; 20 part 'src/sha1.dart';
19 part 'src/sha256.dart'; 21 part 'src/sha256.dart';
22 part 'src/base64.dart';
20 23
21 /** 24 /**
22 * Interface for cryptographic hash functions. 25 * Interface for cryptographic hash functions.
23 * 26 *
24 * The [add] method is used to add data to the hash. The [close] method 27 * The [add] method is used to add data to the hash. The [close] method
25 * is used to extract the message digest. 28 * is used to extract the message digest.
26 * 29 *
27 * Once the [close] method has been called no more data can be added using the 30 * Once the [close] method has been called no more data can be added using the
28 * [add] method. If [add] is called after the first call to [close] a 31 * [add] method. If [add] is called after the first call to [close] a
29 * HashException is thrown. 32 * HashException is thrown.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 * Accepts both URL safe and unsafe Base 64 encoded strings. 104 * Accepts both URL safe and unsafe Base 64 encoded strings.
102 * 105 *
103 * Throws a FormatException exception if input contains invalid characters. 106 * Throws a FormatException exception if input contains invalid characters.
104 * 107 *
105 * Based on [RFC 4648](http://tools.ietf.org/html/rfc4648) 108 * Based on [RFC 4648](http://tools.ietf.org/html/rfc4648)
106 */ 109 */
107 static List<int> base64StringToBytes(String input) { 110 static List<int> base64StringToBytes(String input) {
108 return _CryptoUtils.base64StringToBytes(input); 111 return _CryptoUtils.base64StringToBytes(input);
109 } 112 }
110 } 113 }
OLDNEW
« no previous file with comments | « no previous file | lib/src/base64.dart » ('j') | lib/src/base64.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698