Function to generate longer bit-sequence from shorter sequence with certain properties im not familiar with the terminology of computer-science which makes it pretty difficult to search for the problem I have.

I'm looking for a function that generates a sequence of bits (B) of a given length (i.e. 1024 bit) from a chosen bit-sequence (A) (i.e. 32 bit).

This function needs to have the following properties:


The relation A->B has to be unique
A slight change of A (i.e. 1 bit) results in a slight change of B (~1024bit/32bit = ~32)


While searching I came across hash-algorithms but they achive kind of the oppisite I want to do. They shorten a sequence and a small change of the first one results in a big change of the other one.

Do you know of such a function or do I have to come up with something myself?



Example (with fewer bits):

Let bit-sequence A be given as 0b0101 (integer-representation: 5).
Let function F map A to B so that B = 0b1001 0010 0101 0111 (example). Here, B can be split into 4 4-bit integers (9, 2, 5, 7).

Changing 1 bit of A from 0b0101 (5) to 0b0100 (4) results in 4 changed bits of B so that the resulting bits are 0b1011 0000 0101 0110 (integer: 11, 0, 5, 6).

The 4 integers contained in B will be used in further computations and I'm looking for function F.
Let $\pi$ be a random permutation on $\{1,\ldots,1024\}$, and let $K$ be a random bit string of length 1024 bits. The following mapping seems to satisfy your needs (with probability close to 1):
$$
A \mapsto \pi(A^{32} \oplus K).
$$
In particular, changing $b$ bits of $A$ will result in changing $32b$ bits of the result.

If you are OK with changing more than 32 bits, then you can take a random sparse affine function, that is the function whose $i$th bit is an XOR of a small number of bits of $A$ chosen at random, XORed with a random bit.