Chromium Code Reviews| Index: sdk/lib/crypto/crypto_base.dart |
| diff --git a/sdk/lib/crypto/crypto_base.dart b/sdk/lib/crypto/crypto_base.dart |
| index d1666b51ed9a7bafb0a5537301fb92a67b2577d5..9bb8734829660d2d61ab22defe7111bd51b3bee1 100644 |
| --- a/sdk/lib/crypto/crypto_base.dart |
| +++ b/sdk/lib/crypto/crypto_base.dart |
| @@ -124,12 +124,30 @@ abstract class CryptoUtils { |
| /** |
| * 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'. |
| + * base64 encoded string optionally broken up in to lines of 76 |
|
Lasse Reichstein Nielsen
2013/03/21 14:06:38
Try to have the first line of the doc explain the
mdakin1
2013/03/21 15:27:15
Done,
|
| + * chars separated by '\r\n'. |
| + * Optionally generates url and filename safe encoding if [urlSafe] |
| + * is set to true. |
| + * Based on RFC 4686 http://tools.ietf.org/html/rfc4648 |
|
Lasse Reichstein Nielsen
2013/03/21 14:06:38
4686 -> 4648
mdakin1
2013/03/21 15:27:15
Done.
|
| + * |
| */ |
| - static String bytesToBase64(List<int> bytes, [int lineLength]) { |
| - return _CryptoUtils.bytesToBase64(bytes, lineLength); |
| + static String bytesToBase64(List<int> bytes, {bool urlSafe : false, bool addLineSeparator : false}) { |
| + return _CryptoUtils.bytesToBase64(bytes, urlSafe, addLineSeparator); |
| } |
| + |
| + |
| + /** |
| + * Converts a base64 encoded String into list of bytes. Decoder ignores \r\n |
|
Lasse Reichstein Nielsen
2013/03/21 14:06:38
base64 -> Base64.
into list -> into a list
New par
mdakin1
2013/03/21 15:27:15
Done.
|
| + * from input. By default also ignores all illegal chars unless |
|
Lasse Reichstein Nielsen
2013/03/21 14:06:38
\r\n from inpu -> "\r\n" sequences in the input.
B
mdakin1
2013/03/21 15:27:15
Done.
|
| + * [ignoreErrors] is false. |
|
Lasse Reichstein Nielsen
2013/03/21 14:06:38
New paragraph here. Dartdoc flows like HTML, so th
mdakin1
2013/03/21 15:27:15
Done.
|
| + * Accepts both url safe and unsafe base64 encoded strings. |
|
Lasse Reichstein Nielsen
2013/03/21 14:06:38
url -> URL
base64->Base 64 (just my preference, st
mdakin1
2013/03/21 15:27:15
Done.
|
| + * Returns empty list if [input] is null. |
|
Lasse Reichstein Nielsen
2013/03/21 14:06:38
Returns empty -> Returns an empty
mdakin1
2013/03/21 15:27:15
Done.
|
| + * Based on RFC 4686 http://tools.ietf.org/html/rfc4648 |
|
Lasse Reichstein Nielsen
2013/03/21 14:06:38
4686 -> 4648
mdakin1
2013/03/21 15:27:15
Done.
|
| + */ |
| + static List<int> base64StringToBytes(String input, {bool ignoreErrors : true}) { |
| + return _CryptoUtils.base64StringToBytes(input, ignoreErrors); |
| + } |
| + |
| } |
| /** |