Documentation ¶
Overview ¶
hamming distance calculations in Go
https://github.com/steakknife/hamming
Copyright © 2014, 2015 Barry Allard ¶
MIT license ¶
Usage ¶
The functions are named (CountBits)?(Byte|Uint64)s?. The plural forms are for slices. The CountBits.+ forms are Population Count only, where the bare-type forms are Hamming distance.
import 'github.com/steakknife/hamming' // ... // hamming distance between values hamming.Byte(0xFF, 0x00) // 8 hamming.Byte(0x00, 0x00) // 0 // just count bits in a byte hamming.CountBitsByte(0xA5), // 4
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bytes ¶
hamming distance of two byte buffers, of which the size of the first argument is used for both (panics if b1 is smaller than b0, does not compare b1 beyond length of b0)
func CountBitsByte ¶
func CountBitsBytes ¶
func CountBitsUint64 ¶
func CountBitsUint64s ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.