Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #125 * Email Verification * Little type fix * Error fields fixed
- Loading branch information
1 parent
49e6abb
commit 6851c8d
Showing
6 changed files
with
106 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package app | ||
|
||
import ( | ||
"crypto/md5" | ||
"crypto/rand" | ||
"encoding/hex" | ||
) | ||
|
||
// GetMD5Hash ... | ||
func GetMD5Hash(text []byte) string { | ||
hasher := md5.New() | ||
hasher.Write(text) | ||
return hex.EncodeToString(hasher.Sum(nil)) | ||
} | ||
|
||
// RandomMD5Hash returns random md5 hash for unique conifrim links | ||
func RandomMD5Hash() string { | ||
b := make([]byte, 16) | ||
rand.Read(b) | ||
return GetMD5Hash(b) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters