(Feat): Initial Commit
This commit is contained in:
17
internal/util/hashing/util.go
Normal file
17
internal/util/hashing/util.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package hashing
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func generateSalt(n uint32) ([]byte, error) {
|
||||
result := make([]byte, n)
|
||||
|
||||
_, err := rand.Read(result)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to generate salt: %w", err)
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
Reference in New Issue
Block a user