mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-18 16:17:03 +00:00
19 lines
350 B
Go
19 lines
350 B
Go
package vault
|
|
|
|
import (
|
|
"github.com/ProtonMail/gopenpgp/v2/crypto"
|
|
)
|
|
|
|
// RandomToken is a function that returns a random token.
|
|
// By default, we use crypto.RandomToken to generate tokens.
|
|
var RandomToken = crypto.RandomToken
|
|
|
|
func newRandomToken(size int) []byte {
|
|
token, err := RandomToken(size)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
return token
|
|
}
|