1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2025-02-20 15:37:31 -05:00

19 lines
290 B
Go
Raw Normal View History

package d2animdata
import "strings"
type hashTable [numBlocks]byte
func hashName(name string) byte {
hashBytes := []byte(strings.ToUpper(name))
var hash uint32
for hashByteIdx := range hashBytes {
hash += uint32(hashBytes[hashByteIdx])
}
hash %= numBlocks
return byte(hash)
}