in the beginning, there was darkness
This commit is contained in:
13
data/rand.go
Normal file
13
data/rand.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package data
|
||||
|
||||
const saltLength = 32
|
||||
|
||||
func Salt() ([]byte, error) {
|
||||
salt := make([]byte, saltLength)
|
||||
_, err := rand.Read(salt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return salt, nil
|
||||
}
|
||||
Reference in New Issue
Block a user