File tree Expand file tree Collapse file tree 3 files changed +10
-14
lines changed Expand file tree Collapse file tree 3 files changed +10
-14
lines changed Original file line number Diff line number Diff line change 1+ ## 1.25.14
2+
3+ * Use secure random for url secrets.
4+
15## 1.25.13
26
37* Allow the latest version of ` package:matcher ` .
Original file line number Diff line number Diff line change 22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5+ import 'dart:convert' ;
56import 'dart:math' as math;
67
7- final _rand = math.Random ();
8+ final _rand = math.Random . secure ();
89
9- /// Returns a random 32 character alphanumeric string ([a-zA-Z0-9] ), which is
10- /// suitable as a url secret.
11- String randomUrlSecret () {
12- var buffer = StringBuffer ();
13- while (buffer.length < 32 ) {
14- buffer.write (_alphaChars[_rand.nextInt (_alphaChars.length)]);
15- }
16- return buffer.toString ();
17- }
18-
19- const _alphaChars =
20- '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' ;
10+ /// Returns a random 64 bit token suitable as a url secret.
11+ String randomUrlSecret () =>
12+ base64Url.encode (List .generate (8 , (_) => _rand.nextInt (256 )));
Original file line number Diff line number Diff line change 11name : test
2- version : 1.25.13
2+ version : 1.25.14
33description : >-
44 A full featured library for writing and running Dart tests across platforms.
55repository : https://github.com/dart-lang/test/tree/master/pkgs/test
You can’t perform that action at this time.
0 commit comments