split into packages
This commit is contained in:
parent
2b56832843
commit
c5d41b0965
26 changed files with 328 additions and 449 deletions
14
pkg/db/helper.go
Normal file
14
pkg/db/helper.go
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package db
|
||||
|
||||
import "golang.org/x/crypto/sha3"
|
||||
|
||||
func validatePassword(pw string) (b []byte) {
|
||||
b = []byte(pw)
|
||||
if len(pw) <= 56 {
|
||||
return
|
||||
}
|
||||
hash := sha3.New384()
|
||||
hash.Write(b)
|
||||
b = hash.Sum(nil)
|
||||
return
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue