I need a simple PRNG function of type: Integer = PRNG(n, maxval) as I would like to count from 0 to maxval, not in a linear manner, but in a pseudorandom manner where I still use every value, but only once. For example, "0 to maxval=9" might result in "3,8,4,5,1,9,0,2,6,7", and if I asked the function for "Integer = PRNG(3)" in this case it would return the third value which is 4. (For my actual need maxval is always 64bit so 0xFFFFFFFFFFFFFFFF)
Im hoping this can be accomplished without shuffling a pre-filled array? My googling suggests perhaps a "feedback register" of sorts could be what I'm after but ive got no idea which. Thankyou
ps. are there any CPRNG secure versions of this? I dont need that level of security - PRNG is fine, but just wondering!