Skip to content

v1.2.2

Choose a tag to compare

@Fromsko Fromsko released this 18 Jan 17:51
· 14 commits to main since this release
5de5798
import (
	"crypto/sha256"
	"encoding/hex"
)

// HashString 对内容进行 sha256
func HashString(input string) string {
	hasher := sha256.New()
	hasher.Write([]byte(input))
	hashedBytes := hasher.Sum(nil)
	hashedString := hex.EncodeToString(hashedBytes)
	return hashedString
}