use fnv instead of md5

This commit is contained in:
2022-03-25 20:40:57 -07:00
parent 4d3bbc0c88
commit f101db6d58
3 changed files with 14 additions and 5 deletions

View File

@@ -15,10 +15,10 @@ func TestHashString(t *testing.T) {
String string
Value int
ID string
}{{String: "", Value: 7602086723416769149, ID: "Empty string"},
{String: "123", Value: 1606385479620709231, ID: "123"},
{String: "it's as easy as", Value: 5377981271559288604, ID: "easy"},
{String: "hello colorhash", Value: 4155814819593785823, ID: "hello"}}
}{{String: "", Value: 5472609002491880228, ID: "Empty string"},
{String: "123", Value: 6449148174219763898, ID: "123"},
{String: "it's as easy as", Value: 5908178111834329190, ID: "easy"},
{String: "hello colorhash", Value: 893132354324239557, ID: "hello"}}
for _, tc := range testStrings {
t.Run(tc.ID, func(t *testing.T) {
hash := HashString(tc.String)