go-zero/core/hash/hash_test.go 增加测试 TestMd5Hex (#1128)

master
Mikael 3 years ago committed by GitHub
parent d28cfe5f20
commit 837a9ffa03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,6 +20,11 @@ func TestMd5(t *testing.T) {
assert.Equal(t, md5Digest, actual) assert.Equal(t, md5Digest, actual)
} }
func TestMd5Hex(t *testing.T) {
actual := Md5Hex([]byte(text))
assert.Equal(t, md5Digest, actual)
}
func BenchmarkHashFnv(b *testing.B) { func BenchmarkHashFnv(b *testing.B) {
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
h := fnv.New32() h := fnv.New32()

Loading…
Cancel
Save