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
+
1
5
## 1.25.13
2
6
3
7
* Allow the latest version of ` package:matcher ` .
Original file line number Diff line number Diff line change 2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
+ import 'dart:convert' ;
5
6
import 'dart:math' as math;
6
7
7
- final _rand = math.Random ();
8
+ final _rand = math.Random . secure ();
8
9
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 1
1
name : test
2
- version : 1.25.13
2
+ version : 1.25.14
3
3
description : >-
4
4
A full featured library for writing and running Dart tests across platforms.
5
5
repository : https://github.com/dart-lang/test/tree/master/pkgs/test
You can’t perform that action at this time.
0 commit comments