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

Side by Side Diff: utils/pub/utils.dart

Issue 11263040: Make String.charCodes a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 1 month 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 | « utils/peg/pegparser.dart ('k') | utils/pub/yaml/composer.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 * Generic utility functions. Stuff that should possibly be in core. 6 * Generic utility functions. Stuff that should possibly be in core.
7 */ 7 */
8 library utils; 8 library utils;
9 9
10 import 'dart:crypto'; 10 import 'dart:crypto';
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 for (var match in matcher.allMatches(str)) { 112 for (var match in matcher.allMatches(str)) {
113 if (match.end() == str.length) return true; 113 if (match.end() == str.length) return true;
114 } 114 }
115 return false; 115 return false;
116 } 116 }
117 117
118 /** 118 /**
119 * Returns the hex-encoded sha1 hash of [source]. 119 * Returns the hex-encoded sha1 hash of [source].
120 */ 120 */
121 String sha1(String source) => 121 String sha1(String source) =>
122 CryptoUtils.bytesToHex(new SHA1().update(source.charCodes()).digest()); 122 CryptoUtils.bytesToHex(new SHA1().update(source.charCodes).digest());
123 123
124 /** 124 /**
125 * Returns a [Future] that completes in [milliSeconds]. 125 * Returns a [Future] that completes in [milliSeconds].
126 */ 126 */
127 Future sleep(int milliSeconds) { 127 Future sleep(int milliSeconds) {
128 var completer = new Completer(); 128 var completer = new Completer();
129 new Timer(milliSeconds, completer.complete); 129 new Timer(milliSeconds, completer.complete);
130 return completer.future; 130 return completer.future;
131 } 131 }
OLDNEW
« no previous file with comments | « utils/peg/pegparser.dart ('k') | utils/pub/yaml/composer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698