goimagehash/imagehash18.go
2024-04-05 17:29:30 -06:00

15 lines
160 B
Go

//go:build !go1.9
// +build !go1.9
package goimagehash
func popcnt(x uint64) int {
diff := 0
for x != 0 {
diff += int(x & 1)
x >>= 1
}
return diff
}