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

Unified Diff: lib/src/utils.dart

Issue 1829533002: Drop the crypto dependency. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/runner/browser/platform.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/utils.dart
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index 73e42cb38fd75dba89f25e0592c1b35962b00215..629cac3cf7b0831560ed0aa79fbcc3db89876f98 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -7,7 +7,6 @@ import 'dart:convert';
import 'dart:math' as math;
import 'package:async/async.dart' hide StreamQueue;
-import 'package:crypto/crypto.dart';
import 'package:path/path.dart' as p;
import 'package:shelf/shelf.dart' as shelf;
import 'package:stack_trace/stack_trace.dart';
@@ -428,15 +427,13 @@ void invoke(fn()) {
///
/// [seed] is passed to [math.Random]; [urlSafe] and [addLineSeparator] are
/// passed to [CryptoUtils.bytesToBase64].
-String randomBase64(int bytes, {int seed, bool urlSafe: false,
- bool addLineSeparator: false}) {
+String randomBase64(int bytes, {int seed}) {
var random = new math.Random(seed);
var data = [];
for (var i = 0; i < bytes; i++) {
data.add(random.nextInt(256));
}
- return CryptoUtils.bytesToBase64(data,
- urlSafe: urlSafe, addLineSeparator: addLineSeparator);
+ return BASE64.encode(data);
}
/// Returns middleware that nests all requests beneath the URL prefix [beneath].
« no previous file with comments | « lib/src/runner/browser/platform.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698