Re: Cryptographically strong random numbers

2015-10-16 Thread Jon Ribbens
On 2015-10-16, Steven D'Aprano wrote: > If you have written crypto code that needs random numbers as described > below, I am looking for your feedback. > > Python-Dev is arguing about which of the following three functions should be > included: > > randbelow(end): > return a random integer in

Re: Cryptographically strong random numbers

2015-10-16 Thread Peter Pearson
On Sat, 17 Oct 2015 03:25:03 +1100, Steven D'Aprano wrote: [snip] > randbelow(end): > return a random integer in the half-open interval 0...end > (including 0, excluding end) > > randint(start, end): > return a random integer in the closed interval start...end > (including both sta

Re: Cryptographically strong random numbers

2015-10-16 Thread Oscar Benjamin
On Fri, 16 Oct 2015 18:16 Marko Rauhamaa wrote: Steven D'Aprano : > Python-Dev is arguing about which of the following three functions should be > included: > > randbelow(end): > return a random integer in the half-open interval 0...end > (including 0, excluding end) > > randint(start, e

Re: Cryptographically strong random numbers

2015-10-16 Thread Brian Gladman
On 16/10/2015 17:25, Steven D'Aprano wrote: > Hello folks, [snip detail] > randbelow(end): > return a random integer in the half-open interval 0...end > (including 0, excluding end) > > randint(start, end): > return a random integer in the closed interval start...end > (including

Re: Cryptographically strong random numbers

2015-10-16 Thread Marko Rauhamaa
Steven D'Aprano : > Python-Dev is arguing about which of the following three functions should be > included: > > randbelow(end): > return a random integer in the half-open interval 0...end > (including 0, excluding end) > > randint(start, end): > return a random integer in the closed i

Cryptographically strong random numbers

2015-10-16 Thread Steven D'Aprano
Hello folks, Over on the Python-Dev mailing list there is an argument going on about PEP 506, the "secrets" module, for generating crypto random numbers and tokens. If you have written crypto code that needs random numbers as described below, I am looking for your feedback. Python-Dev is arguin