Please don't top post!
See below for my comments.
On 09/07/14 07:04, Kynn Jones wrote:
Thanks to Gavin and Martijn for their suggestions. They're both simple
good-ol' LCGs, and both avoid the need to check for collisions.
I ultimately went with a multiplicative LCG, like Martijn's, mostly
be
Thanks to Gavin and Martijn for their suggestions. They're both simple
good-ol' LCGs, and both avoid the need to check for collisions.
I ultimately went with a multiplicative LCG, like Martijn's, mostly because
I understand better how it avoids collisions, so it was easier for me to
tweak it in v
On Fri, Jul 04, 2014 at 09:24:31AM -0400, Kynn Jones wrote:
> I'm looking for a way to implement pseudorandom primary keys in the range
> 10..99.
>
> The randomization scheme does not need to be cryptographically strong. As
> long as it is not easy to figure out in a few minutes it's good
On 05/07/14 15:48, Gavin Flower wrote:
On 05/07/14 01:24, Kynn Jones wrote:
I'm looking for a way to implement pseudorandom primary keys in the
range 10..99.
The randomization scheme does not need to be cryptographically
strong. As long as it is not easy to figure out in a few minute
On 05/07/14 01:24, Kynn Jones wrote:
I'm looking for a way to implement pseudorandom primary keys in the
range 10..99.
The randomization scheme does not need to be cryptographically
strong. As long as it is not easy to figure out in a few minutes it's
good enough.
My starting point
Kynn Jones writes:
> The requirements I've been given for the keys is that they be numeric,
> reasonably easy to type (hence, no 40-digit keys), never beginning with 0,
> and carrying no additional information content (or even suggesting it).
Why not just
(random()*89)::int + 10
This is
On Fri, Jul 4, 2014 at 10:13 AM, hubert depesz lubaczewski wrote:
> How many rows do you plan on having in this table?
>
Currently, only around 10K, but there's expectation that the number will
grow. It's hard to predict how much, hence the generous extra space.
> Why this particular key rang
How many rows do you plan on having in this table? Why this particular key
range?
depesz
On Fri, Jul 4, 2014 at 3:24 PM, Kynn Jones wrote:
> I'm looking for a way to implement pseudorandom primary keys in the range
> 10..99.
>
> The randomization scheme does not need to be cryptographi
I'm looking for a way to implement pseudorandom primary keys in the range
10..99.
The randomization scheme does not need to be cryptographically strong. As
long as it is not easy to figure out in a few minutes it's good enough.
My starting point for this is the following earlier message