News for hackers. Stuff that matters.
Re:Googlebot’s JavaScript random() function is deterministic by kmbriedis on Wednesday February 07, 2018 @04:57AM (#16323367)
Every random() function is kind of deterministic, but still very interesting discovery!
Re:Googlebot’s JavaScript random() function is deterministic by skrebbel on Wednesday February 07, 2018 @06:34AM (#16323761)
Totally down nitpick alley yeah, but: Not if fed by an external source of randomness (eg cosmic rays).
Re:Googlebot’s JavaScript random() function is deterministic by philbarr on Wednesday February 07, 2018 @10:49AM (#16325211)
> (eg cosmic rays).

YouTube copyright violations?

The chance of getting a response from Google support?

Re:Googlebot’s JavaScript random() function is deterministic by skrebbel on Wednesday February 07, 2018 @11:17AM (#16325434)
I love those. A bit easy to game if you have the right job at Google, but still this is cool.

I'd also assume that the Twitter firehose could be a great source of randomness.

Re:Googlebot’s JavaScript random() function is deterministic by Godel_unicode on Wednesday February 07, 2018 @11:51AM (#16325811)
Since we're nitpicking; deterministic effectively means same input produces same output. Input includes the seed. All PRNGs are deterministic.
Re:Googlebot’s JavaScript random() function is deterministic by squeaky-clean on Wednesday February 07, 2018 @12:21PM (#16326140)
Javascript does not allow you to set the seed for the default PRNG. So for our purposes it's essentially non-deterministic. You need to use a custom library if you want to be able to specify your seed.
Re:Googlebot’s JavaScript random() function is deterministic by Godel_unicode on Wednesday February 07, 2018 @05:55PM (#16328724)
Continuing the nitpicking: "JavaScript" isn't actually what prevents setting the seed, you're talking about a common implementation detail of specific JavaScript runtimes (Mozilla’s documentation says their seed can't be changed, for instance). A runtime developer could, as Googlebot apparently does, seed the prng with a constant value. You could also use some user-provided constant as the seed. All three are compliant with the letter of the spec.

Bottom line: the PRNG is, as all PRNGs are, deterministic. The user-facing math.random API using the underlying PRNG may or may not be. Those are distinct things.

From the spec's description of math.random with regard to random or pseudo-random: "...using an implementation‑ dependent algorithm or strategy."

Re:Googlebot’s JavaScript random() function is deterministic by TomAnthony on Wednesday February 07, 2018 @05:13AM (#16323446)
Yeah, as was pointed out in /r/programming, it is perhaps an imperfect title in hindsight!
Re:Googlebot’s JavaScript random() function is deterministic by KyeRussell on Wednesday February 07, 2018 @05:15AM (#16323455)
Technically true, but pointless pedantry when I'm sure that most people are on the the same page wrt pseudorandomness. Typically what I'd expect of /r/programming.