git.iko.soy/typeable/oauth2-proxy
on proxy-mapping help sign in
17 lines 275 B history raw
1package encryption
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