Golang 生成唯一ID:使用UUID和SHA1算法
import ( "fmt" "strings" "github.com/google/uuid" )
func main() { nsrsbh := 'test' key := strings.ReplaceAll(uuid.NewSHA1(uuid.NameSpace_DNS, []byte(nsrsbh)).String(), '-', '') fmt.Println(key) }
原文地址: https://www.cveoy.top/t/topic/mXEb 著作权归作者所有。请勿转载和采集!