Skip to content

struct PermutationTable

Kelvin edited this page Jun 11, 2017 · 2 revisions
Structure

PermutationTable

An 8-bit permutation table useful for generating pseudo-random hash values.

Permutation tables can be used, among other things, to hash cell noise to produce a Voronoi diagram.


Symbols

Initializers

init(seed:Int)

Creates an instance with the given random seed containing the values 0 ... 255 shuffled in a random order.

Instance methods

func hash(_ h1:Int) -> UInt8

Hash a single integer value.

func hash(_ h1:Int, _ h2:Int) -> UInt8

Hash two integer values.

func hash(_ h1:Int, _ h2:Int, _ h3:Int) -> UInt8

Hash three integer values.