syndicate-2017/examples/webchat/server/util.rkt

10 lines
248 B
Racket
Raw Permalink Normal View History

2016-11-30 05:08:35 +00:00
#lang racket/base
(provide random-hex-string)
(require (only-in file/sha1 bytes->hex-string))
(require (only-in racket/random crypto-random-bytes))
(define (random-hex-string half-length)
(bytes->hex-string (crypto-random-bytes half-length)))