git.iko.soy/typeable/oauth2-proxy
on v3.2.0 help sign in
17 lines 271 B history raw
1package cookie
3import (
4 "crypto/rand"
5 "fmt"
6)
8// Nonce generates a random 16 byte string to be used as a nonce
9func Nonce() (nonce string, err error) {
10 b := make([]byte, 16)
11 _, err = rand.Read(b)
12 if err != nil {
13 return
14 }
15 nonce = fmt.Sprintf("%x", b)
16 return