mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-26 00:58:11 -07:00
update resume support to draft/resume-0.3
This commit is contained in:
@@ -14,6 +14,10 @@ var (
|
||||
b32encoder = base32.NewEncoding("abcdefghijklmnopqrstuvwxyz234567").WithPadding(base32.NoPadding)
|
||||
)
|
||||
|
||||
const (
|
||||
SecretTokenLength = 26
|
||||
)
|
||||
|
||||
// generate a secret token that cannot be brute-forced via online attacks
|
||||
func GenerateSecretToken() string {
|
||||
// 128 bits of entropy are enough to resist any online attack:
|
||||
|
||||
@@ -16,7 +16,7 @@ const (
|
||||
|
||||
func TestGenerateSecretToken(t *testing.T) {
|
||||
token := GenerateSecretToken()
|
||||
if len(token) < 22 {
|
||||
if len(token) != SecretTokenLength {
|
||||
t.Errorf("bad token: %v", token)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user