News for hackers. Stuff that matters.
Re:Ask HN: We just had an actual UUID v4 collision... by LocalH on Friday May 08, 2026 @01:52PM (#48066506)
This is why CloudFlare has done what they did with the lava lamp wall. Not that the wall is such a great source of entropy on its own - I'm sure it's not their only source, but you can never have too many sources of entropy - but it makes it visible in a way that can grab those who don't fully understand the concepts of RNGs and how entropy plays into that.

The more sources of entropy, the more closely you approach "perfect" randomization. And a large chunk of those entropy sources need to be non-deterministic. Even on the small level, local applications running on local systems, like games, can use things like the mouse coordinates, the timings between button presses, the exact frame count since game start before the player presses Start to greatly enhance randomness while still using PRNGs under the hood

Yes, for the latter, that's technically deterministic (and the older the game considered, the more deterministic it is, see TAS runs of old games obliterating the "RNG"). But when you have fifty different parameters feeding into the initial seed, that's fifty things an attack would have to perfectly predict or replay (and there are other ways to avoid replay attacks that can be layered on top)

If CloudFlare had less than 100 different sources of entropy, I'd be disappointed. And that's assuming their algorithm for blending those entropy sources into a single seed value is good

Re:Ask HN: We just had an actual UUID v4 collision... by __s on Friday May 08, 2026 @04:14PM (#48068190)
Old games are RTA viable to RNG manip: https://m.youtube.com/watch?v=Bgh30BiWG58
Re:Ask HN: We just had an actual UUID v4 collision... by victorbjorklund on Friday May 08, 2026 @02:36PM (#48067014)
If I understand it the Lava lamps are 90% PR/fun. They have a lot of other sources for entropy that scales better.
Re:Ask HN: We just had an actual UUID v4 collision... by euroderf on Friday May 08, 2026 @02:57PM (#48067251)
Ant farm ? Hamster wheels ? Anything critter-driven should provide some entropy.
Re:Ask HN: We just had an actual UUID v4 collision... by BSVogler on Friday May 08, 2026 @03:02PM (#48067299)
I once read that noise of camera in total darkness is apparently a good source.
Re:Ask HN: We just had an actual UUID v4 collision... by unilynx on Friday May 08, 2026 @03:12PM (#48067414)
The noise probably makes the lava lamp wall just as effective as pointing the camera at the Mona Lisa - the lamps themselves are not that unpredictable frame-to-frame.
Re:Ask HN: We just had an actual UUID v4 collision... by LocalH on Friday May 08, 2026 @04:18PM (#48068242)
For the record, the lamps and camera are present in their lobby afaik, so you can actually go there, stand in front of them, and slightly affect the entropy.

A cool parlor trick, certainly.

Re:Ask HN: We just had an actual UUID v4 collision... by amelius on Friday May 08, 2026 @05:27PM (#48068990)
You can already have a good entropy source from a single resistor.

https://en.wikipedia.org/wiki/Johnson%E2%80%93Nyquist_noise

Re:Ask HN: We just had an actual UUID v4 collision... by pyuser583 on Saturday May 09, 2026 @11:39AM (#48075832)
This is what gets me - entropy is hard, but not that hard. I get it goes against everything a computer is built to do, but so does telling time.
Re:Ask HN: We just had an actual UUID v4 collision... by wpm on Friday May 08, 2026 @11:14PM (#48071464)
Would a CRT TV tuned to channel 3 and no RF input be a good source?
Re:Ask HN: We just had an actual UUID v4 collision... by ssl-3 on Saturday May 09, 2026 @06:39AM (#48073818)
In the sense that RF noise can be a source of entropy: Sorta*. But one doesn't need the whole thrift-store television set to do that; the visual aspect of a CRT displaying analog video snow just adds style points**.

*: Sorta, because if someone discovers that the entropy is derived from an analog TV tuned to channel 3, then they also know how to influence it from outside.

**: Style points can have value; it's OK to have fun with work. But that's a secondary function.

Re:Ask HN: We just had an actual UUID v4 collision... by nxobject on Sunday May 10, 2026 @02:01AM (#48081401)
I imagine that there might still be a way to swing by with RF equipment and tip the scales in your favor. And if you're important enough, I'm sure there'll be someone motivatd enough to do this. After all, Polymarket was motivating enough for someone to take a hair dryer to a weather station...

https://www.theguardian.com/world/2026/apr/23/hairdryer-or-l...

Re:Ask HN: We just had an actual UUID v4 collision... by iberator on Sunday May 10, 2026 @08:20PM (#48089602)
better to just switch to... random channel every while :) Not perfect but something.
Re:Ask HN: We just had an actual UUID v4 collision... by FuriouslyAdrift on Friday May 08, 2026 @04:04PM (#48068023)
Re:Ask HN: We just had an actual UUID v4 collision... by conception on Friday May 08, 2026 @04:40PM (#48068530)
Re:Ask HN: We just had an actual UUID v4 collision... by throw-the-towel on Friday May 08, 2026 @04:57PM (#48068692)
Speaking of ants, Fourmilab (i.e. John Walker, of Autodesk fame) used to provide a random number generator powered by background radiation: https://www.fourmilab.ch/hotbits/
Re:Ask HN: We just had an actual UUID v4 collision... by pverheggen on Friday May 08, 2026 @04:38PM (#48068496)
Re:Ask HN: We just had an actual UUID v4 collision... by geon on Saturday May 09, 2026 @04:09AM (#48072998)
Wouldn’t thermal noise in a resistor make more practical sense?
Re:Ask HN: We just had an actual UUID v4 collision... by drzaiusx11 on Saturday May 09, 2026 @09:45AM (#48074925)
I prefer cosmic microwave background radiation (CMBR) as my RNG of choice
Re:Ask HN: We just had an actual UUID v4 collision... by iberator on Sunday May 10, 2026 @08:21PM (#48089608)
until someone uses microwave lol
Re:Ask HN: We just had an actual UUID v4 collision... by nyrikki on Friday May 08, 2026 @08:42PM (#48070567)
The original from SGI back in the mid 90's, before CPUs had RDRAND instructions etc... was a an actually practical solution.

At the time I was at the Internet company that originally got online-gaming banned in the US, we were looking at CCDs and Cesium emitters that required a license etc...

While I am not sure, it seems cloudflare basically implemented one after SGI's[0] patent expired.

The patent and the licensing cost and adding SGI was a major blocker for us doing it, the startup closed before we found a real solution. But the best PRNGs like Blum Blum Shub were way too slow at the time. But things did improve quickly at that time.

[0] https://patents.google.com/patent/US5732138A/en

Re:Ask HN: We just had an actual UUID v4 collision... by pyuser583 on Saturday May 09, 2026 @11:38AM (#48075826)
SGI was pretty amazing. I know some folks who worked there - Cray too. There’s a loyalty that just doesn’t exist any more - and arguably isn’t earned anymore.
Re:Ask HN: We just had an actual UUID v4 collision... by dheera on Friday May 08, 2026 @04:54PM (#48068660)
The lava lamps are just for show.

You can get entropy just by plugging an oscilloscope into a pile of dirt and cranking the gain up.

Re:Ask HN: We just had an actual UUID v4 collision... by adrian_b on Friday May 08, 2026 @05:13PM (#48068845)
Any high-gain amplifier can be used, with its input connected to a resistor or a diode.

For instance you can use the microphone input of a PC, together with an additional external amplifier made with an audio amplifier integrated circuit or an operational amplifier integrated circuit and with a diode or a resistor at its input. The microphone input of PCs provides a 5 V voltage that can be sufficient as a power supply for a noise source plugged in it.

Such a true RNG can be made on a small PCB with an audio jack, so you can plug it into any PC with microphone input and have a true RNG that you can trust better than the RNG included in modern Intel and AMD CPUs. In the past, many AMD CPUs had defective internal RNGs. Moreover, both for Intel and for AMD it is impossible to verify whether the internal RNG does what it claims to do or it generates predictable pseudo-random numbers.

Re:Ask HN: We just had an actual UUID v4 collision... by tliltocatl on Saturday May 09, 2026 @05:34AM (#48073511)
Meh. The problem is that it might start receiving you local radio station and end up deterministic enough to screw you. So you need to shield the dirt properly.
Re:Ask HN: We just had an actual UUID v4 collision... by greiskul on Friday May 08, 2026 @05:39PM (#48069103)
> you can never have too many sources of entropy

This is so true. And the beauty is that with algorithms, we don't even need to know much about the entropy to be able to extract it.

There is the Von Neumann method of generating an unbiased coin from a biased coin. Of throwing it twice, and checking if you got HT or TH. And completely discarding all HH or TT results. It doesn't matter if the coin you are using is 20% or 80%, the result will be a true 50/50.

There are more modern algorithms that can be even better (in that they need less coin tosses if you have a very unbalanced coin).

And then there is modern cryptographic hashing. Feed it all the bits you can. Collisions end up only happening in the real world if every single one of those bits is identical. So if you have actual entropy being fed, that cannot be controlled, predicted, or replicated, modern cryptography tells you that the end result is unique.

Re:Ask HN: We just had an actual UUID v4 collision... by ms_menardi on Saturday May 09, 2026 @12:41AM (#48071877)
> There is the Von Neumann method of generating an unbiased coin from a biased coin. Of throwing it twice, and checking if you got HT or TH. And completely discarding all HH or TT results. It doesn't matter if the coin you are using is 20% or 80%, the result will be a true 50/50.

This blew my mind. Thank you!

I had to think about it a bit, so for anyone scratching their head right now trying to figure it out, consider it this way:

what matters is the ordering, of heads-then-tails, or tails-then-heads.

It doesn't matter that it's biased one way or the other, if you keep flipping pairs until you get a result with two different values, it's a 50/50 chance whether the less-likely result comes first, or second.

You might only have a 20% chance of any particular pair having a tails (for example), but in the cases where you do have a tails, it's a 50/50 chance that it comes first or second.

Re:Ask HN: We just had an actual UUID v4 collision... by susam on Saturday May 09, 2026 @01:19AM (#48072030)
And for people who like equations, here is my attempt at explaining it.

Assume each flip is independent and the bias remains same in each flip.

Let

  P(H) = p,
  P(T) = 1 - p.
Then

  P(HH) = p^2,
  P(HT) = p(1 - p),
  P(TH) = (1 - p)p,
  P(TT) = (1 - p)^2.
Therefore

  P(HT or TH) = 2p(1 - p).
Now calculate

  P(HT | HT or TH) = p(1 - p) / (2p(1 - p)) = 1/2,
  P(TH | HT or TH) = (1 - p)p / (2p(1 - p)) = 1/2.
Re:Ask HN: We just had an actual UUID v4 collision... by taegee on Saturday May 09, 2026 @03:23AM (#48072715)
You don't need conditional probability here, as the flips are independent.

It's just p(H)p(T).

And p(H)p(T) = p(T)p(H), thus 2*p(H)p(T) = 2p(1-p).

Re:Ask HN: We just had an actual UUID v4 collision... by cdaringe on Saturday May 09, 2026 @11:40AM (#48075845)
Thats how i noodled thru it internally
Re:Ask HN: We just had an actual UUID v4 collision... by clickety_clack on Saturday May 09, 2026 @02:02PM (#48076887)
That wasn’t what he was trying to prove, but the proof could be done without conditionals like this:

If: p(H)p(T) = p(T)p(H)

And: p(H)p(T) + p(T)p(H) = 1

Then: p(H)p(T) = p(T)p(H) = 0.5

Re:Ask HN: We just had an actual UUID v4 collision... by susam on Saturday May 09, 2026 @09:14PM (#48079988)
Independence tells us how to compute the probability of a sequence like HT or TH:

  P(HT) = P(H)P(T) = p(1 - p)
But the question I am addressing is not just "what is the probability of HT?" It is "given that the two flips are different, what is the probability that the order was HT rather than TH?"

That is a conditional probability:

  P(HT | HT or TH)
Re:Ask HN: We just had an actual UUID v4 collision... by taegee on Saturday May 09, 2026 @02:25AM (#48072372)
Afaics it's just basic commutativity – p(H)p(T) = p(T)p(H) – since instances are independent.

Same, of course, holds for flipping it multiple times. But there you get more than Head or Tail (binomnk(n, k)).

Re:Ask HN: We just had an actual UUID v4 collision... by throwaway89865 on Saturday May 09, 2026 @12:50AM (#48071918)
Not very random if it's only TH or HT. Trivial to brute force with no more than two tries!
Re:Ask HN: We just had an actual UUID v4 collision... by aws_ls on Saturday May 09, 2026 @05:55AM (#48073605)
Thanks for your explanation. I did not get it in the first read, and was too lazy to think, until saw your comment.

Just want to point out, that one is actually doing the experiment with a biased coin, then one must ignore all pairs.

e.g in case a coin which is heavily biased, say .9 H and .1 T. One should start with ignoring all the HH pairs, and start only at odd index. Lest, one picks a value like HHHHT (in the case the 2nd HH pair was not skipped, instead they greedily picked up the first HT, which will make the experiment HT biased).

Re:Ask HN: We just had an actual UUID v4 collision... by sporkland on Saturday May 09, 2026 @09:36AM (#48074864)
I was doubting this for a minute as I wondered with a significantly biased coin towards the head side would you be more likely to get HT. With probability problems like Monty Hall I like to think about extreme cases like say it's 99 heads to every 1 tails. You'd expect HT 0.99% of the time. Ditto TH.
Re:Ask HN: We just had an actual UUID v4 collision... by dash2 on Saturday May 09, 2026 @10:03AM (#48075078)
You can’t flip coins until you get the first different outcome… You have to flip twice each time, until you get a pair with different outcomes.
Re:Ask HN: We just had an actual UUID v4 collision... by pyuser583 on Saturday May 09, 2026 @11:37AM (#48075814)
Oh wow that’s really amazing. What’s the source - I love Von Neumann.
Re:Ask HN: We just had an actual UUID v4 collision... by hun3 on Saturday May 09, 2026 @06:50AM (#48073868)
(Note that this still assumes that each biased-coin toss is i.i.d.)
Re:Ask HN: We just had an actual UUID v4 collision... by MathMonkeyMan on Saturday May 09, 2026 @07:53PM (#48079532)
I remember hearing about an interview problem from a while back, and the trick was to use exclusive-or. Now I understand why.
Re:Ask HN: We just had an actual UUID v4 collision... by bmitc on Saturday May 09, 2026 @04:34AM (#48073182)
> This is why CloudFlare has done what they did with the lava lamp wall.

Interesting. I wonder how true it actually is that they use it like they claim here: https://www.cloudflare.com/learning/ssl/lava-lamp-encryption.... It's in one of their lobbies, so doesn't that make it susceptible to an attack in some way? I'm not knowledgeable enough to know, but I figured if they actually used that method, they'd have a more controlled environment.

I also don't fully understand it. A large part of that wall is static. And the camera isn't going to pick up on the stochastic properties of the lava as much as exists in the real world. So it feels like their images will be very statistically similar.

Re:Ask HN: We just had an actual UUID v4 collision... by Melatonic on Saturday May 09, 2026 @03:44PM (#48077642)
It's probably just one of many sources. Just by being in one physical location it would be vulnerable to a network outage (ignoring any potential for attacks)