my computer is about to die!!!
This commit is contained in:
1 parent
d863dc3bd1
commit
e80f2601ab
13 files changed
+244
-11
No files matched your search
@@ -12,6 +12,14 @@ type Hash string
|
||||
|
||||
const SHA512 Hash = "sha512"
|
||||
|
||||
func GetHashByHashName(hashName string) (Hash, error) {
|
||||
ret := Hash(hashName)
|
||||
if _, err := ret.New(); err != nil {
|
||||
return "", errors.New("unsupported hash function " + hashName)
|
||||
}
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func (this Hash) New() (hash.Hash, error) {
|
||||
switch this {
|
||||
case SHA512:
|
||||
|
||||
Reference in new issue
Block a user