Welcome, space traveler!

Mathematician + Developer + Cat DadMath, code, cats, books and faith. Since 2024.

Hash Garden

Deterministic botanical entropy. Type a seed and pick a hash function, and its output grows a glowing garden: the same seed always grows the same plants. Flip one bit and the whole thing changes. Hover any branch to see the exact hash bytes it grew from. Press Space to pause.

Garden

Species ...
Digest ...
Graph ...

Controls

Seed
Mutation none
crypto self-tests
Garden
Look

The math

Nothing in the garden is random. Every angle, length, color and petal is read from one long stream of hash output, so a seed always grows the same garden, and a share link carries the whole garden in a few words.

Seed to stream. The grower hashes a domain-separated message built from a fixed tag, the grower's name, your seed and the mutation number m, with zero bytes keeping the fields apart:

B=hash-garden-v1∥0∥grower∥0∥seed∥0∥m.

The fixed-length hashes (SHA-256, SHA3-256, Ascon-Hash256) give 32 bytes at a time, so they run in counter mode, with the counter k as four little-endian bytes:

S=H(B∥0∥0)∥H(B∥0∥1)∥H(B∥0∥2)∥⋯

The extendable-output functions (SHAKE128, Ascon-XOF128) simply squeeze S=XOF(B,L) for as many bytes L as the garden asks for. The extra plants in a grove append one more field, 0∥plant-k, so each grows from its own stream. In a mixed bed the grower's name already keeps the five streams apart, so each plant there is exactly the plant that grower would grow alone.

Bytes to shapes. Four bytes make a number in [0,1),

u=b0+28b1+216b2+224b3232,

and every choice is a function of a fresh u: a length between a and b is a+(b−a)u, a whole number from a to b is a+⌊(b−a+1)u⌋, and a coin that lands heads with probability p is the test u<p. The plant grows breadth-first. Each branch reads its curve, its leaves, maybe a bloom, and then how many children it will have and where along it they sprout. That makes the plant a branching process (a Galton-Watson tree) driven by the stream, cut off after

N=round(42+1.45ρc)

branches, where c is the Complexity slider and ρ is the species' density. Hover a branch to see the stream bytes it was read from; those bytes also decided its leaves and where its children start, so the whole lit-up subtree hangs off them.

Wind. Each branch bends rigidly about its base, and its angle is its parent's angle plus its own bend:

ϕb(t)=ϕparent(t)+0.011w(d+1)0.8(g(x,t)+0.55sin⁡(ωdt+θb)),
g(x,t)=0.65+0.35sin⁡(0.55t−0.004x)+0.15sin⁡(1.7t+0.011x).

Here w is the Wind slider, d the branch depth, x where the branch starts, ωd=1.9+0.15d, and θb a per-branch phase; the trunk takes only a third of its bend. The gust g rolls across the garden from left to right, and because the bends add up along the path from the root, twigs swing far more than the trunk, the way a real tree moves.

The avalanche. A good hash has the avalanche property: flip any single input bit and every output bit flips with probability one half, independently of the others. So the number of digest bits that change is binomial,

X∼Binomial(256,12),E[X]=128,σ=256⋅12⋅12=8,

and about 95% of flips change between 112 and 144 bits. Set View to Avalanche to watch it happen: the readout counts the changed bits of the full 256-bit digest (changed hex digits are pink), and the two gardens have nothing in common, not even their first branch.

SHA-256 grows the Crystalline cypress: narrow forks, one or two children per branch, crystal leaves and star blooms. SHA-256 is a Merkle-Damgard hash: the message is cut into 512-bit blocks, and each block is mixed into a 256-bit state by 64 rounds of

T1=h+Σ1(e)+Ch(e,f,g)+Kt+Wt,T2=Σ0(a)+Maj(a,b,c),

where Ch(e,f,g)=(e∧f)⊕(¬e∧g) uses e to choose bits from f or g, and Maj takes a bitwise majority vote.

References: NIST FIPS 180-4, "Secure Hash Standard" (2015); NIST FIPS 202, "SHA-3 Standard" (2015); NIST SP 800-232, "Ascon-Based Lightweight Cryptography Standards" (2025); Webster and Tavares, "On the Design of S-Boxes" (1985), for the avalanche criterion.

Prime clock

2

a new prime every two seconds