mirror of
https://github.com/rclone/rclone.git
synced 2024-12-11 17:51:12 +01:00
16 lines
304 B
Go
16 lines
304 B
Go
// Copyright (C) 2019 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
package macaroon
|
|
|
|
import (
|
|
"crypto/rand"
|
|
)
|
|
|
|
// NewCaveat returns a Caveat with a random generated nonce.
|
|
func NewCaveat() (Caveat, error) {
|
|
var buf [8]byte
|
|
_, err := rand.Read(buf[:])
|
|
return Caveat{Nonce: buf[:]}, err
|
|
}
|