jeudi 9 mars 2023

Pseudo-random bijection

I would like to map a subset of the first integers to itself, so that each access is O(1), and so that the function is pure and does not store the complete mapping. There are no strong requirement like being photographically secure, the bijection must just not be trivial and "look" unpredictable.

Is it possible to create such a function ?

I can shuffle an array, but I would like to know if there a more direct method. I saw the method proposed at Create a random bijective function which has same domain and range, but it is not O(1).




Aucun commentaire:

Enregistrer un commentaire