Set ArgonMaxInstances to number of cores
parent
7dbcb18ebf
commit
192b777ac3
|
@ -19,6 +19,7 @@ package account
|
|||
|
||||
import (
|
||||
"regexp"
|
||||
"runtime"
|
||||
|
||||
"golang.org/x/crypto/argon2"
|
||||
)
|
||||
|
@ -34,13 +35,13 @@ const (
|
|||
ArgonKeySize = 32
|
||||
ArgonSaltSize = 16
|
||||
|
||||
ArgonMaxInstances = 16
|
||||
|
||||
UUIDSize = 16
|
||||
TokenSize = 32
|
||||
)
|
||||
|
||||
var (
|
||||
ArgonMaxInstances = runtime.NumCPU()
|
||||
|
||||
isValidUsername = regexp.MustCompile(`^\w{1,16}$`).MatchString
|
||||
semaphore = make(chan bool, ArgonMaxInstances)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue