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

Side by Side Diff: lib/src/crypto_utils.dart

Issue 1586453002: Get rid of all the library tags. (Closed) Base URL: git@github.com:dart-lang/crypto.git@master
Patch Set: Created 4 years, 11 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 | « lib/src/base64/encoder_sink.dart ('k') | lib/src/digest.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 library crypto.crypto_utils;
6
7 import 'base64.dart'; 5 import 'base64.dart';
8 6
9 /// Utility methods for working with message digests. 7 /// Utility methods for working with message digests.
10 abstract class CryptoUtils { 8 abstract class CryptoUtils {
11 /// Convert a list of bytes (for example a message digest) into a hexadecimal 9 /// Convert a list of bytes (for example a message digest) into a hexadecimal
12 /// string. 10 /// string.
13 static String bytesToHex(List<int> bytes) { 11 static String bytesToHex(List<int> bytes) {
14 var result = new StringBuffer(); 12 var result = new StringBuffer();
15 for (var part in bytes) { 13 for (var part in bytes) {
16 result.write('${part < 16 ? '0' : ''}${part.toRadixString(16)}'); 14 result.write('${part < 16 ? '0' : ''}${part.toRadixString(16)}');
(...skipping 21 matching lines...) Expand all
38 /// Converts a [Base64-encoded][rfc] String into list of bytes. 36 /// Converts a [Base64-encoded][rfc] String into list of bytes.
39 /// 37 ///
40 /// [rfc]: https://tools.ietf.org/html/rfc4648 38 /// [rfc]: https://tools.ietf.org/html/rfc4648
41 /// 39 ///
42 /// This ignores "\r\n" sequences in [input]. It accepts both URL-safe and 40 /// This ignores "\r\n" sequences in [input]. It accepts both URL-safe and
43 /// -unsafe Base 64 encoded strings. 41 /// -unsafe Base 64 encoded strings.
44 /// 42 ///
45 /// Throws a [FormatException] if [input] contains invalid characters. 43 /// Throws a [FormatException] if [input] contains invalid characters.
46 static List<int> base64StringToBytes(String input) => BASE64.decode(input); 44 static List<int> base64StringToBytes(String input) => BASE64.decode(input);
47 } 45 }
OLDNEW
« no previous file with comments | « lib/src/base64/encoder_sink.dart ('k') | lib/src/digest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698