I am in need of a function which takes inputs of random type and length and outputs evenly-distributed random SDRs of configurable size and sparsity, with very low likelihood of overlap when around length 1024, sparsity 2%. Security is not a concern, only uniformity. Overlapping bits in extremely similar inputs should NOT produce output SDRs with overlap. However, the exact same input should always result in the exact same output SDR. Wondering if anyone has written something like this.
My first thought for a possible implementation would be to convert the input to string and run it through a uniform hashing function like SHA1. Then take the output hash and select random digits from the hash using a common seed, converting to 0 or 1 based on whether or not it is greater than 7, and inserting that into random positions in an SDR, using the hash as the seed, until it reaches the desired sparsity.
Is there a more elegant/ better/ faster way of achieving this? I suspect there is something obvious that is not coming to my mind right away