Skip to content

Commit 4e662fc

Browse files
LiberalArtistjryans
authored andcommitted
src/randomness.rkt: Use crypto-random-bytes.
1 parent 31aa7b0 commit 4e662fc

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/randomness.rkt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
(provide random-bytes
44
random-bytes/base64)
55

6-
(require net/base64)
7-
8-
(define (random-bytes n)
9-
(with-input-from-file "/dev/urandom"
10-
(lambda ()
11-
(read-bytes n))))
6+
(require (rename-in racket/random
7+
[crypto-random-bytes random-bytes])
8+
net/base64)
129

1310
(define (random-bytes/base64 n)
1411
(base64-encode (random-bytes n) #""))

0 commit comments

Comments
 (0)