Documentation
¶
Index ¶
- func End(data []uint64, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11 uint64) (uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, ...)
- func EndPartial(h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11 uint64) (uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, ...)
- func Hash128(in []byte, seed uint64) (uint64, uint64)
- func Hash32(in []byte, seed uint32) uint32
- func Hash64(in []byte, seed uint64) uint64
- func Mix(data []uint64, s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11 uint64) (uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, ...)
- func Rot64(x, k uint64) uint64
- func ShortEnd(h0, h1, h2, h3 uint64) (uint64, uint64, uint64, uint64)
- func ShortMix(h0, h1, h2, h3 uint64) (uint64, uint64, uint64, uint64)
- func SpookyHash128(in []byte, hash1, hash2 uint64) (uint64, uint64)
- func SpookyHashShort(in []byte, hash1, hash2 uint64) (uint64, uint64)
- func U8tou32le(p []byte) uint64
- func U8tou64le(p []byte) uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EndPartial ¶
func Mix ¶
func Mix(data []uint64, s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11 uint64) (uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64)
This is used if the input is 96 bytes long or longer.
The internal state is fully overwritten every 96 bytes. Every input bit appears to cause at least 128 bits of entropy before 96 other bytes are combined, when run forward or backward
For every input bit, Two inputs differing in just that input bit Where "differ" means xor or subtraction And the base value is random When run forward or backwards one Mix
I tried 3 pairs of each; they all differed by at least 212 bits.
func ShortEnd ¶
Mix all 4 inputs together so that h0, h1 are a hash of them all.
For two inputs differing in just the input bits Where "differ" means xor or subtraction And the base value is random, or a counting value starting at that bit The final result will have each bit of h0, h1 flip For every input bit, with probability 50 +- .3% (it is probably better than that) For every pair of input bits, with probability 50 +- .75% (the worst case is approximately that)
func ShortMix ¶
The goal is for each bit of the input to expand into 128 bits of
apparent entropy before it is fully overwritten.
n trials both set and cleared at least m bits of h0 h1 h2 h3
n: 2 m: 29 n: 3 m: 46 n: 4 m: 57 n: 5 m: 107 n: 6 m: 146 n: 7 m: 152
when run forwards or backwards for all 1-bit and 2-bit diffs with diffs defined by either xor or subtraction with a base of all zeros plus a counter, or plus another bit, or random
func SpookyHash128 ¶
do the whole hash in one call
func SpookyHashShort ¶
short hash ... it could be used on any message, but it's used by Spooky just for short messages.
Types ¶
This section is empty.