From e2f67996a608346ea3f3525ef2febf6ca5d2b78c Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Thu, 4 Jul 2024 13:13:23 +0530 Subject: refactor: drop http api, move to sqlc/postgresql --- db/utils.go | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 db/utils.go (limited to 'db/utils.go') 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 -} -- cgit v1.2.3