Skip to content

Commit bf5ad8e

Browse files
johanbrandhorstgopherbot
authored andcommitted
crypto/rand: replace shift with constant
It was mentioned after CL 463993 was merged that it is uncommon to use shifts for numbers other than powers of ten. Replace the shift with a base 10 constant. Change-Id: I11c90128740109a59add40ed7b680f7bcc9715ad Reviewed-on: https://go-review.googlesource.com/c/go/+/465275 Auto-Submit: Johan Brandhorst-Satzkorn <[email protected]> Run-TryBot: Johan Brandhorst-Satzkorn <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Auto-Submit: Brad Fitzpatrick <[email protected]> Reviewed-by: David Chase <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent bf8d142 commit bf5ad8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/crypto/rand/rand_js.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import "syscall/js"
1010

1111
// The maximum buffer size for crypto.getRandomValues is 65536 bytes.
1212
// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#exceptions
13-
const maxGetRandomRead = 1 << 16
13+
const maxGetRandomRead = 64 << 10
1414

1515
var batchedGetRandom func([]byte) error
1616

0 commit comments

Comments
 (0)