mirror of
https://codeberg.org/cunicu/cunicu.git
synced 2026-04-24 16:09:43 +08:00
3ed24bac04
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
16 lines
272 B
Go
16 lines
272 B
Go
// Package crypto implements basic crypto primitives used in the project
|
|
package crypto
|
|
|
|
import "crypto/rand"
|
|
|
|
func GetNonce(len int) (Nonce, error) {
|
|
var nonce = make(Nonce, len)
|
|
|
|
_, err := rand.Read(nonce)
|
|
if err != nil {
|
|
return nonce, err
|
|
}
|
|
|
|
return nonce, nil
|
|
}
|