seed
) must always produce the exact same output—the algorithm must be fully deterministic.seed
) must produce a unique and distinguishable result.When creating variations, ensure they are easily distinguishable at a glance. The left example shows good practice where differences are clear, while the right example shows patterns that are too similar and hard to differentiate.
We are looking for algorithms in 3 categories, each being uniquely defined by the seed set to your algorithm. The possible types of seeds are the following:
[64, 255, 0, 8]
The seed to your algorithm will be an integer number expressed in Little Endian as 8-bytes.
e.g. [45, 0, 0, 0, 0, 0, 0, 0]
(integer 69)
The integer represented by the seed is:
0
10_000_000_000
You can convert the seed into a number using the numeric(seed)
helper function.
Seeds Samples - Personal_Id-Seeds.txt
[72, 178, 250, 161, 99, 11, 142, 176, 152, 101, 140, 230, 14, 190, 144, 148, 47, 155, 251, 45, 180, 193, 157, 5, 231, 6, 0, 233, 6, 35, 32, 81]
There are several functions provided for operating on seeds:
Get the nth bit from the seed, indexed from 0. Returns either 0 or 1.
Get a number built from the bits of seed of the given span from and to.
Get a number built from all bits of the seed, somewhere between 0 and 2**32 - 1 inclusive.
Return an array of numbers, parts in length, each using approximately the same number of bits from the seed.
Return a function which itself takes no arguments and returns a stream of random numbers between 0 and 1. This uses the Prando algorithm. There is also cheapRandomGenerator
(using SFC32) and secureRandomGenerator
(using SHA-256).
Returns a bigint representing the seed. Useful for transforming a Procedural Personal seed into a single integer number representation aka the Personal Id/Citizen Id.
Can be extended if found useful
Participants agree that their submitted code will be licensed under CC BY-NC-SA 4.0 and thereby will be potentially used in the Proof-of-Ink project to generate tattoo designs for individuals. Usage is up to be determined by the Polkadot Open Governance platform.