Re: [PATCH v3 1/2] compat: add a mkstemps() compatibility function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Antriksh Pany schrieb:
> 2. tv_usec has a decimal value range of 0-999999  (10^6 usec make 1
> sec). Which means that tv_usec fits completely in 20 bits (or less).
> (tv_usec << 16) yields a number that fits completely in 36 bits (or
> less). Max value of this number is 999999 * 2^16, or for convenience,
> about M = 10^6 * 2^16. This number (in the range of 0 to M) goes on to
> be divided by D=62^6. Also, M > D. Thus, there is about a  D / M * 100
> ~ 87 % probability of the division M / D working out to be zero. i.e,
> in 87% cases, the last division (v/= num_letters) will cause 'v' to
> become 0.

But this value (after the 6th division, mind you) is not used. v is used
the last time after the 5th division; at this time it still carries enough
randomness: 62^5 < 2^32.

-- Hannes

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]