From 62dda96159055ff9d485078f257445b964eb5220 Mon Sep 17 00:00:00 2001 From: ᴜɴᴋɴᴡᴏɴ Date: Sat, 11 Apr 2020 01:25:19 +0800 Subject: access_token: migrate to GORM and add tests (#6086) * access_token: migrate to GORM * Add tests * Fix tests * Fix test clock --- internal/tool/tool.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'internal/tool') diff --git a/internal/tool/tool.go b/internal/tool/tool.go index 380f1069..eeed80e6 100644 --- a/internal/tool/tool.go +++ b/internal/tool/tool.go @@ -28,6 +28,7 @@ import ( ) // MD5Bytes encodes string to MD5 bytes. +// TODO: Move to hashutil.MD5Bytes. func MD5Bytes(str string) []byte { m := md5.New() _, _ = m.Write([]byte(str)) @@ -35,11 +36,13 @@ func MD5Bytes(str string) []byte { } // MD5 encodes string to MD5 hex value. +// TODO: Move to hashutil.MD5. func MD5(str string) string { return hex.EncodeToString(MD5Bytes(str)) } // SHA1 encodes string to SHA1 hex value. +// TODO: Move to hashutil.SHA1. func SHA1(str string) string { h := sha1.New() _, _ = h.Write([]byte(str)) -- cgit v1.2.3