how would you use, say, the string "abc" as the seed of an rng? would you change it into 0x616263, or 123, or hash it with sha1 (or some other hash), or something else?
A:
Hashing with a high-quality hashing algorithm seems like the best solution. However, depending on how many bits you have to seed with, you might have to use only a part of the generated hash. This shouldn't be a problem if you use a cryptographically strong algorithm that has well-distributed outputs.
Mike Daniels
2010-03-28 04:22:27
Why was this downvoted? Am I missing something?
Gabe
2010-03-28 04:41:51
A:
I'm assuming
- you want a repeatable pseudorandom sequence
- your RNG expects an integer.
In this case, the answer is: it doesn't matter.
egrunin
2010-03-28 05:12:51