lundi 12 juin 2023

Good hashing algorithm for integer vector?

I am trying to come up with an algorithm that takes N 32 bit integers and computes a set of N pseudo random floating point values from 0 to 1 by scrambling the bits of the integers.

I am trying to search this up but all I get are hashing algorithms for cryptography or for data structures like hashtables.

The main challenge I am facing atm is that merely casting a large bit sequence into floats is very unpredictable so trying to get a normalized floating point value is proving tircky.

The final use case is to have a consistent way to generate a random vector for a given set of integer coordinates.

i.e. a mathematical map from a tuple of natural numbers N^n to a tuple of floating point coordinates sampled from the unit hyper cube. I am using this to generate "random" vector fields in a grid.




Aucun commentaire:

Enregistrer un commentaire