The EighteenIDGenerator is a class in PonderUtilCore that produces a quasi-base64 encoding of a stream of 18 random bytes generated by a good (in this case java.util.SecureRandom) random number generator. In case anyone is worried about the possibilities of collision of these IDs over time, the formula for probability of non-collision is $p = e^{-n^2/2k}$. Inverting and approximating for small p we gain $n = \sqrt{2k/p}$. For 144 bits of hash (10^43), if we ask how many pages (resources) must be generated before the probability of collision reaches 1 in a billion (10^-9), we require 10^17 hashes, i.e. 200Pb of pages if only one byte per page.

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-) was last changed on 19-Jul-2006 09:36 by UnknownAuthor