Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Map ¶
collision-free pseudorandom sequence using a feistel cipher in cycle walking mode useful for avoiding hotspots in free-lists, or otherwise obfuscating a unique index. this is NOT encryption. it just makes a sequence look random to the human eye
for example this generates a sequence from 0 to 1000 in deterministic but random-looking order
var max uint32 = 1000; for i:=uint32(0);i<max;i++ { fmt.Println(feistel(i, max, "feistel is cool")); }
outputs all numbers between 0 and 1000 like [2, 821, 76, etc.. when using a different seed, it creates a different sequence remember this is not actual cryptography and a determined attacker will figure out the seed
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.