diff options
author | sinanmohd <sinan@sinanmohd.com> | 2024-07-04 13:13:23 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2024-07-05 17:02:06 +0530 |
commit | e2f67996a608346ea3f3525ef2febf6ca5d2b78c (patch) | |
tree | 932f766b65ed5a6ff3d57c772292a2b75210d9aa /db/utils.go | |
parent | e309091d17720b69c53172a41c0ea45ad7b66911 (diff) |
refactor: drop http api, move to sqlc/postgresql
Diffstat (limited to 'db/utils.go')
-rw-r--r-- | db/utils.go | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/db/utils.go b/db/utils.go deleted file mode 100644 index 0b0f1cb..0000000 --- a/db/utils.go +++ /dev/null @@ -1,24 +0,0 @@ -package db - -import ( - "encoding/base64" - "lukechampine.com/blake3" - "math/rand" -) - -func ToBlake3(pass string) string { - hash := blake3.Sum512([]byte(pass)) - hash64b := base64.StdEncoding.EncodeToString(hash[:]) - - return "blake3-" + hash64b -} - -func GenRandomString(n int) (string, error) { - b := make([]byte, n) - _, err := rand.Read(b) - if err != nil { - return "", err - } - - return base64.URLEncoding.EncodeToString(b)[:n], nil -} |