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

Side by Side Diff: lib/crypto.dart

Issue 1350913002: Run the formatter over crypto. (Closed) Base URL: git@github.com:dart-lang/crypto.git@master
Patch Set: Fix a missing value. Created 5 years, 3 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') | no next file with comments »
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 /** 5 /**
6 * Cryptographic algorithms, with support for hash functions such as 6 * Cryptographic algorithms, with support for hash functions such as
7 * SHA-1, SHA-256, HMAC, and MD5. 7 * SHA-1, SHA-256, HMAC, and MD5.
8 */ 8 */
9 library crypto; 9 library crypto;
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 * 80 *
81 * If [addLineSeparator] is true, the resulting string will be 81 * If [addLineSeparator] is true, the resulting string will be
82 * broken into lines of 76 characters, separated by "\r\n". 82 * broken into lines of 76 characters, separated by "\r\n".
83 * 83 *
84 * If [urlSafe] is true, the result is URL and filename safe. 84 * If [urlSafe] is true, the result is URL and filename safe.
85 * 85 *
86 * Based on [RFC 4648](http://tools.ietf.org/html/rfc4648) 86 * Based on [RFC 4648](http://tools.ietf.org/html/rfc4648)
87 * 87 *
88 */ 88 */
89 static String bytesToBase64(List<int> bytes, 89 static String bytesToBase64(List<int> bytes,
90 {bool urlSafe : false, 90 {bool urlSafe: false, bool addLineSeparator: false}) {
91 bool addLineSeparator : false}) { 91 return _CryptoUtils.bytesToBase64(bytes, urlSafe, addLineSeparator);
92 return _CryptoUtils.bytesToBase64(bytes,
93 urlSafe,
94 addLineSeparator);
95 } 92 }
96 93
97
98 /** 94 /**
99 * Converts a Base 64 encoded String into list of bytes. 95 * Converts a Base 64 encoded String into list of bytes.
100 * 96 *
101 * Decoder ignores "\r\n" sequences from input. 97 * Decoder ignores "\r\n" sequences from input.
102 * 98 *
103 * Accepts both URL safe and unsafe Base 64 encoded strings. 99 * Accepts both URL safe and unsafe Base 64 encoded strings.
104 * 100 *
105 * Throws a FormatException exception if input contains invalid characters. 101 * Throws a FormatException exception if input contains invalid characters.
106 * 102 *
107 * Based on [RFC 4648](http://tools.ietf.org/html/rfc4648) 103 * Based on [RFC 4648](http://tools.ietf.org/html/rfc4648)
108 */ 104 */
109 static List<int> base64StringToBytes(String input) { 105 static List<int> base64StringToBytes(String input) {
110 return _CryptoUtils.base64StringToBytes(input); 106 return _CryptoUtils.base64StringToBytes(input);
111 } 107 }
112 } 108 }
OLDNEW
« no previous file with comments | « no previous file | lib/src/base64.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698