remove ginext/mongoext (no-dep lib)

This commit is contained in:
2022-10-27 16:07:42 +02:00
parent 568d7bd5e3
commit 47f123b86f
31 changed files with 6 additions and 123 deletions

22
cryptext/hash.go Normal file
View File

@@ -0,0 +1,22 @@
package cryptext
import (
"crypto/sha256"
"fmt"
)
func StrSha256(v string) string {
h := sha256.New()
h.Write([]byte(v))
bs := h.Sum(nil)
sh := fmt.Sprintf("%x", bs)
return sh
}
func BytesSha256(v []byte) string {
h := sha256.New()
h.Write(v)
bs := h.Sum(nil)
sh := fmt.Sprintf("%x", bs)
return sh
}