I am building a security mechanism and I need a Pseudorandom functionality in my app. More particularly I need to convert a String to fix length.
My strings are random already, they just to long so I want to convert them to fix size. A trivial solution(the one that I am using now) will be just cut the extra characters, the problem with this approach that it reduce from the strength of my original random that I used to generate the string at the first place.
So I need some sort of method that will except an array of bytes and will give me new array of bytes, but it will be always the same output for given input.
And I dont want to use solutions like XOR or some other math, I want it to be psado random, and I will store the psado random key or data in local storage.