9 // String hashes a string to a unique hashcode.
11 // crc32 returns a uint32, but for our use we need
12 // and non negative integer. Here we cast to an integer
13 // and invert it if the result is negative.
14 func String(s string) int {
15 v := int(crc32.ChecksumIEEE([]byte(s)))
26 // Strings hashes a list of strings to a unique hashcode.
27 func Strings(strings []string) string {
30 for _, s := range strings {
31 buf.WriteString(fmt.Sprintf("%s-", s))
34 return fmt.Sprintf("%d", String(buf.String()))