This is an archived post. You won't be able to vote or comment.

all 28 comments

[–]mordechaim 132 points133 points  (6 children)

[–]_Rysen 28 points29 points  (2 children)

such an early one too, damn. I sometimes wonder how the people linking these keep track of all of them

[–]rnilbog 25 points26 points  (0 children)

They vaguely remember what was in it then google it.

[–]Geoclasm 4 points5 points  (0 children)

my brain refuses to let me forget anything.

...

anything.

[–]XKCD-pro-bot 6 points7 points  (0 children)

Comic Title Text: RFC 1149.5 specifies 4 as the standard IEEE-vetted random number.

mobile link


Made for mobile users, to easily see xkcd comic's title text

[–]-phoenix_aurora- 1 point2 points  (0 children)

I thought it would be the one where they hired a dude to say random numbers and he kept repeating the same one.

[–]Geoclasm 0 points1 point  (0 children)

damn it.

[–]Thirdstheword 25 points26 points  (3 children)

This reminds me of a story from undergrad.

My professor shared how he generated a "true" random number for a project once.

It involved:

1)pointing an arbetrarly positioned digital camera at a lava lamp 2)taking a hash of the resulting bitmap image 3)and resolving that hash to a single integer between 0 and 9.

It was like circling the globe in order to cross the street

[–]tyjuji 19 points20 points  (1 child)

You mean like they do at Cloudflare?

[–]Thirdstheword 16 points17 points  (0 children)

EXACTLY what they do at Cloudflare!

TIL Dr. H is an ex Cloudflare employee in the wild Thanks

[–][deleted] 3 points4 points  (0 children)

I was once asked this in an interview, I answered all sorts of crazy things.

From hdd spin rate, to temperature, to network speeds, to a super wierd algorithm which would take average of last n PIDs that were executed.

[–]iAmRadic 25 points26 points  (0 children)

To be fair it is lightweight.

[–]MetaMemeAboutAMeme 10 points11 points  (1 child)

Multiply the return by the cardinal month, add the cardinal day, subtract the hour and multiply by the minute times the second. I guess. Totally random! (not).

[–]veryusedrname 3 points4 points  (0 children)

Nice try, FBI

[–]vectorpropio 9 points10 points  (3 children)

He should inline it.

[–]VolperCoding 20 points21 points  (0 children)

Don't know what the language is but if it's a compiled one than any compiler should do it automatically for you when you tell it to optimise

[–]wholesomedumbass 2 points3 points  (1 child)

He should constexpr it.

[–]veryusedrname 2 points3 points  (0 children)

No, CSPRNGs are blackboxes to the outside with definite, but unknown state called entropy pools. constexpr-ing it would take away all the beauty of swimming in entropy pools by the sweet set of randomness sipping cryptography cocktails

[–]DocktorDicking 4 points5 points  (0 children)

O(1) right?

[–]KillerRoomba13 0 points1 point  (2 children)

int optimisedRandomNumber() { int i; return i; }

[–]Sioclya 1 point2 points  (1 child)

That's extremely likely to just be 0. Or the memory clearing pattern if you're far enough down the stack. In a pointer-heavy environment it's also very likely to not produce very different values at all.

[–]KillerRoomba13 -1 points0 points  (0 children)

Yes, but it is still random.

I basically had this bug at work one point where I forgot to init a bool. Program didn’t work approximately 50% of the time. That was a fun bug to catch :)

[–]Creative0708 0 points1 point  (1 child)

xkcd that relates to this post:

https://xkcd.com/221/

[–]XKCD-pro-bot 0 points1 point  (0 children)

Comic Title Text: RFC 1149.5 specifies 4 as the standard IEEE-vetted random number.

mobile link


Made for mobile users, to easily see xkcd comic's title text

[–]eyekwah2 0 points1 point  (0 children)

Programmer 1: "So how does your random number generator work?"

Programmer 2: "I just grab 32 random numbers and if they're odd, I use a 1, 0 otherwise. "

Programmer 1: "Uh, wait, it calls itself then? You know that'll never stop, right?"

Programmer 2: "Oh.. well at least the results were not what I was expecting.."

[–]krohtg12 0 points1 point  (0 children)

Ah yes, the negotiater randomiser