Make a unique filesystem path, without creating the file

Jon Ribbens jon+usenet at unequivocal.co.uk
Mon Feb 22 19:26:01 EST 2016


On 2016-02-23, Chris Angelico <rosuav at gmail.com> wrote:
> On Tue, Feb 23, 2016 at 11:08 AM, Jon Ribbens
><jon+usenet at unequivocal.co.uk> wrote:
>>> If you generate 2**128 + 1 such numbers, you are *guaranteed* to
>>
>> ... have expired due to the heat death of the universe.
>
> Maybe... but by the time you get to 2**64 of them, you have a 50%
> chance of a collision. (That's either utterly intuitive or completely
> counter-intuitive, depending on who you are.)

Um, did you mean to say 2**127? Are you thinking of the
birthday paradox or something, which doesn't apply here?



More information about the Python-list mailing list