dchest/uniuri — pull request #3 by morhekil (2014-08-09 13:17:34+00:00)
Title: fixed an endless loop when length of chars is a divisor of 256

Hi,

when using your library, I came across an edge case - ``NewLenChars`` drops into an infinite loop when the length of its ``chars`` parameter is a divisor of 256 - ``maxrb`` become zero in this case, an ``c >= maxrb`` is always true on line 59. I believe the correct condition here should be a strict greater-than (and, for example, [that page](http://zuttobenkyou.wordpress.com/2012/10/18/generating-random-numbers-without-modulo-bias/) supports this version, too) - and it makes sense, as we don't have a modulo bias in this case, as all possible values are equally represented in the remainder.

I also added a test to verify the correct behaviour of that function now, hope that helps.

Thank you.