Skip to content

Commit

Permalink
change md5 to sha256
Browse files Browse the repository at this point in the history
Signed-off-by: zhangl <[email protected]>
  • Loading branch information
LiilyZhang committed Mar 19, 2024
1 parent 3907d26 commit 5566e90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cutil/cutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package cutil

import (
"bufio"
"crypto/md5"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"encoding/json"
Expand Down Expand Up @@ -779,9 +779,9 @@ func RemoveArchFromServiceId(sId string) string {
return sId_no_arch
}

// GetHashFromString returns the md5 hash for given string
// GetHashFromString returns the sha256 hash for given string
func GetHashFromString(str string) string {
hasher := md5.New()
hasher := sha256.New()
hasher.Write([]byte(str))
return hex.EncodeToString(hasher.Sum(nil))
}
Expand Down

0 comments on commit 5566e90

Please sign in to comment.