Global Trend Radar
Hacker News US tech 2026-05-08 16:57

HNに聞く: 実際にUUID v4の衝突が発生しました...

原題: Ask HN: We just had an actual UUID v4 collision...

元記事を開く →

分析結果

カテゴリ
エネルギー
重要度
52
トレンドスコア
14
要約
最近、UUID v4の衝突が実際に発生した事例についての質問です。UUID v4は、ユニークな識別子を生成するために広く使用されていますが、衝突が起こる可能性があることが示されました。この問題がどのように発生したのか、またその影響についての議論が期待されています。
キーワード
I know what you're thinking... and I still can't believe it, but... This morning, our database flagged a duplicate UUID (v4). I checked, thinking it may have been a double-insert bug or something, but no. The original UUID was from a record added in 2025 (about a year ago), and today the system inserted a new document with a fresh UUIDv4 and it came up with the exact same one: b6133fd6-70fe-4fe3-bed6-8ca8fc9386cd We're using this: https://www.npmjs.com/package/uuid I thought this is technically impossible, and it will never happen, and since we're not modifying the UUIDs in any way, I really wonder how that.... is possible!? We're literally only calling: import { v4 as uuidv4 } from "uuid"; const document_id = uuidv4(); ... and then insert into the database, that's it. Additionally, the database only has about 15.000 records, and now one collision. Statistically... impossible. Has that ever happened to anyone?! What in the... Comments URL: https://news.ycombinator.com/item?id=48060054 Points: 13 # Comments: 21 I know what you're thinking... and I still can't believe it, but... This morning, our database flagged a duplicate UUID (v4). I checked, thinking it may have been a double-insert bug or something, but no. The original UUID was from a record added in 2025 (about a year ago), and today the system inserted a new document with a fresh UUIDv4 and it came up with the exact same one: b6133fd6-70fe-4fe3-bed6-8ca8fc9386cd We're using this: https://www.npmjs.com/package/uuid I thought this is technically impossible, and it will never happen, and since we're not modifying the UUIDs in any way, I really wonder how that.... is possible!? We're literally only calling: import { v4 as uuidv4 } from "uuid"; const document_id = uuidv4(); ... and then insert into the database, that's it. Additionally, the database only has about 15.000 records, and now one collision. Statistically... impossible. Has that ever happened to anyone?! What in the... Comments URL: https://news.ycombinator.com/item?id=48060054 Points: 13 # Comments: 21