On Sunday, February 7, 2010, Otto Moerbeek wrote: > That is still wrong for this purpose. Although random(3) is a better > random number generator than rand, is still a cryptographic weak > generator. > > Better use arc4random()
Or rather, since he needs to reduce the range, use arc4random_uniform() (That C++ made me cry. Iterating across a map<> to convert an integer in the range 1..56 to a character?!? If only C++ had a datastructure which gave O(1) lookup for small indexes, like an array does in C.) Philip Guenther