Key generator

Deterministic: the same input always yields the same code.