frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Network-debug – A CLI tool to fix slow Wi-Fi and poor network tuning on Linux

https://github.com/shua-ie/network-debug
1•shua-ie•34s ago•1 comments

Show HN: Mednotegen, medical synthetic note generator

https://github.com/nortelabs/mednotegen
1•sirbraavos•2m ago•0 comments

AI challenge to find lost Amazonian civilizations draws critics

https://www.science.org/content/article/ai-challenge-find-lost-amazonian-civilizations-draws-critics
1•bikenaga•2m ago•0 comments

Elon Musk's Grok AI chatbot is posting antisemitic comments

https://www.cnbc.com/2025/07/08/elon-musks-grok-ai-chatbot-is-posting-antisemitic-comments-.html
1•mdhb•3m ago•1 comments

WebAssembly: How Low Can a Bytecode Go?

https://queue.acm.org/detail.cfm?id=3746172
1•matt_d•8m ago•0 comments

When in Doubt, Go for a Walk

https://fabiansjournal.bearblog.dev/when-in-doubt-go-for-a-walk/
2•anotherevan•9m ago•0 comments

Swiss cheese model

https://en.wikipedia.org/wiki/Swiss_cheese_model
1•transpute•9m ago•0 comments

Renoise 3.5 - Feature Showcase [video]

https://www.youtube.com/watch?v=9c9Qq5LieBY
1•xhevahir•12m ago•0 comments

Class of Models with Potential to Represent Fundamental Physics

https://arxiv.org/abs/2004.08210
1•Anon84•13m ago•0 comments

3D stacking method created to overcome traditional semiconductor limitations

https://techxplore.com/news/2025-06-3d-chip-stacking-method-traditional.html
1•PaulHoule•16m ago•0 comments

Confidential AI Inference with Attestation: Run LLMs and Agents on Tees

https://github.com/nearai/private-ml-sdk
1•transpute•17m ago•0 comments

Can ChatGPT "see" red? Results of study are nuanced

https://chan.usc.edu/news/latest/can-chatgpt-actually-see-red-new-results-of-google-funded-study-are-nuanced
1•geox•20m ago•0 comments

Elon Musk's Grok praises Hitler, shares antisemitic tropes in new posts

https://www.axios.com/2025/07/08/elon-musk-grok-x-twitter-hitler-posts
20•12_throw_away•20m ago•4 comments

Alpha-One 7B LLM Agentic/Generative AI Agent

https://pine64.com/product/alpha-one-7b-llm-agentic-generative-ai-agent-us-version/
1•sarusso•22m ago•0 comments

US Court nullifies FTC requirement for click-to-cancel

https://arstechnica.com/tech-policy/2025/07/us-court-cancels-ftc-rule-that-would-have-made-canceling-subscriptions-easier/
1•gausswho•22m ago•1 comments

Up the kriek: Apple gets punchy in Brussels DMA compliance workshop

https://brucelawson.co.uk/2025/up-the-kriek-apple-gets-punchy-in-brussels-dma-compliance-workshop/
2•archagon•23m ago•0 comments

US 'click to cancel' rule blocked by appeals court

https://www.reuters.com/legal/legalindustry/us-click-cancel-rule-blocked-by-appeals-court-2025-07-08/
4•petethomas•24m ago•1 comments

Xenharmlib: A music theory library that supports non-western harmonic systems

https://xenharmlib.readthedocs.io/en/latest/
2•retooth•28m ago•0 comments

Colossal Biosciences to de-extinct giant Moa bird

https://www.stuff.co.nz/nz-news/360750914/we-will-de-extinct-moa-within-next-decade-says-us-bioscience-company
2•mingabunga•30m ago•0 comments

Build with Claude

https://www.anthropic.com/learn/build-with-claude
2•zackify•30m ago•0 comments

A.I. slop and the epidemic of Bad writing [video]

https://www.youtube.com/watch?v=JJLoLdyJ5-g
1•zahlman•33m ago•0 comments

Amarok 3.3 "Far Above the Clouds" released

https://blogs.kde.org/2025/07/08/amarok-3.3-far-above-the-clouds-released/
2•LorenDB•33m ago•0 comments

"Watershed moment:" Big battery storage prices hit record low in China auction

https://reneweconomy.com.au/watershed-moment-big-battery-storage-prices-hit-record-low-in-huge-china-auction/
4•toomuchtodo•33m ago•2 comments

China Wants to Use 115,000 Banned Nvidia Chips to Fulfil Its AI Ambitions

https://www.bloomberg.com/graphics/2025-china-data-centers-nvidia-chips/
1•littlexsparkee•39m ago•1 comments

Bayeux Tapestry to be loaned to the UK for first time

https://www.independent.co.uk/news/uk/home-news/bayeux-tapestry-british-museum-macron-b2784743.html
1•pseudolus•41m ago•0 comments

Why Do Some Language Models Fake Alignment While Others Don't?

https://arxiv.org/abs/2506.18032
1•mfiguiere•41m ago•0 comments

Inflation expectations drift back down to pre-tariff levels, Fed survey shows

https://www.cnbc.com/2025/07/08/inflation-expectations-drift-back-down-to-pre-tariff-levels-new-york-fed-survey-shows.html
2•TMWNN•43m ago•1 comments

Show HN: Did that MCP Server leak your database?

https://github.com/tansive/tansive
1•anand-tan•47m ago•0 comments

Agency

https://www.henrikkarlsson.xyz/p/agency
1•Curiositry•50m ago•0 comments

FakeFind

2•FakeFind_ai•51m ago•0 comments
Open in hackernews

Fast cryptographically safe GUID generator for Go

https://github.com/sdrapkin/guid
15•sdrapkin•4h ago

Comments

sdrapkin•4h ago
Much faster (~10x) than standard github.com/google/uuid package

I'm interested in feedback from the HN community.

throwaway894345•3h ago
Why is it so much faster than `uuid`?
sdrapkin•3h ago
It generates entropy 4kb-at-a-time (instead of on each call), and uses a cache-pool instead of single cache behind a lock (which is what standard uuid does in "RandPool=ON" mode).
cyberax•3h ago
So this automatically makes it unsafe in case of VM snapshots.

The Linux kernel now has an optimization that makes it safe: https://lwn.net/Articles/983186/

Go should automatically benefit from this, if they use the vDSO getrandom().

maxmcd•3h ago
Ah cool, the note here is also interesting: https://pkg.go.dev/github.com/google/uuid#EnableRandPool
evil-olive•1h ago
what real-world problem, if any, does 10x faster UUID generation solve?

from your readme, `guid.New()` is 6~10 ns, so presumably the standard UUID package takes 60-100 ns?

say I generate a UUID, and then use that UUID when inserting a row into my database, let's say committing that transaction takes 1 msec (1 million ns)

if I get a speedup of 90 ns from using a faster UUID package, will that even be noticeable in my benchmarks? it seems likely to be lost in the noise.

honestly, this seems like going on a 7-day road trip, and sprinting from your front door to your car because it'll get you there faster.

sdrapkin•38m ago
Amazon AWS S3 web servers process millions of requests per second, and each response generates a random Request-Id. It’s not exactly 16 bytes, but this is a very realistic scenario where guids are used in hot path. If you are writing a cute-kitten blog, might as well use Python instead..
amluto•3h ago
On an extremely quick review:

- This uses global state under the hood. Surprise! Is it thread safe? I’m not a Go expert, but it looks non-thread-safe.

- The copying code reminds me of old-school awful C buffer handling code. Maybe it’s right. Maybe it’s wrong. But it’s not obviously right.

- The actual meat is a cryptographic randomness cache. This is a subtle thing, and all the best practices are missing. Where’s the backtracking protection? What if the program forks? vDSO getrandom() knows how to do this correctly — something high-level should use it, not reimplement it incorrectly.

sdrapkin•3h ago
Thanks for your feedback. If you are skilled in Golang, I suggest you review the code more thoroughly for a more accurate understanding (especially compared to what standard uuid does).
Groxx•3h ago
Global use looks fine - it's a very-simply-used sync pool to do larger blocks of rand reads, which makes plenty of sense for performance.

Unsafe use also looks fine, values either don't escape the function (a type string->byte type cast for function signature reasons) or they do but they're new temporary data (the byte->string cast, which is fine because there's no risk of reusing or modifying the original bytes).

I'm going to intentionally not make any claims to "cryptographic security" or "is this a GUID" as I'm not super clear on the details there. The code looks pretty normal to me though, with the possible exception of the base64 encoding (why not base64.URLEncoding? https://pkg.go.dev/encoding/base64#pkg-variables).

sa46•3h ago
> This uses global state under the hood.

Looks safe to me. It uses `crypto/rand.Read` which is declared as safe for concurrent use. The cache is accessed via sync.Pool which is thread safe. As a check, I ran the tests with `-race` and it passed.

deathanatos•3h ago
These aren't GUIDs[1].

If it isn't meant to follow the RFC, … just find a new word. (There are plenty of alternate schemes out there, too.)

[1]: https://www.rfc-editor.org/rfc/rfc9562.html

sdrapkin•2h ago
IMHO "Guid" is just as well known (Wikipedia agrees: https://en.wikipedia.org/wiki/Universally_unique_identifier), and "UUID" was already taken by Google.
majewsky•2h ago
> "UUID" was already taken by Google

Your link also says that the term UUID predates the founding of Google by over a decade.

danbruc•2h ago
I think the point is that this just generates 16 random bytes whereas UUIDs/GUIDs have structure, they at least have a variant fields indicating what kind of UUID/GUID it is. The closest thing to all random bytes would be variant 10xx, version 4 or 8.
sdrapkin•1h ago
You are correct - Guid very specifically and intentionally generates a structure of 16 random bytes. In decades of programming I've never needed a random 16-byte structure to have a "internal versioned structure". In very rare cases this is truly needed, bit-twiddling post-generation can cheaply fix it (but not the other way around). Which is why all these "versions" and "variants" in standard universally applicable libraries are a complete waste of entropy and cycles.
danbruc•1h ago
I do not think I have seen or noticed code that inspects UUID variants either but I could certainly imagine that such code is out there, for example to protect against accidental information leakage from UUID variants that are not purely random. With that in mind it seems a good idea to adhere to the standards if one uses an established name. Neither the few lost bits nor the effort to correctly indicate the variant sound like real issues to me.
taeric•59m ago
I was on a team once that would add server information to ids. Between that and using the version that has a date on it, it made debugging things MUCH easier. Just plug in the id and tooling could easily determine which logs to look into for when it was generated. Obviously, you may still need to widen your search for many reasons. But it is hard for me to think this is on most people's threat model.
saclark11•1h ago
> "UUID" was already taken by Google.

This shouldn't really matter as your import paths are obviously different. `github.com/google/uuid` and `github.com/sdrapkin/guid` can happily coexist. Any file/codebase importing both (which would ideally be avoided in the first place) can alias them.

> IMHO "Guid" is just as well known

I think the point the commenter was trying to make is that these do not adhere to the UUID spec. You don't specify which version, but judging by the docs and your comparison to `github.com/google/uuid`, I'd wager most folks looking at this library would assume they are supposed to be V4 UUIDs.

sdrapkin•1h ago
> This shouldn't really matter as your import paths are obviously different.

I'm aware of that, of course. Guid is intentionally named differently from "uuid" (both as a package and as a type) to ensure there is no confusion between them in code. It is not the goal of Guid to mimic/inherit all uuid APIs. Guid is its own package, with a different API surface and roadmap (ie. I'll borrow what makes sense and do things differently when it makes sense).

CafeRacer•3h ago
Would have been nice if that included timestamp information, to make them orderable. Similar to what uuid v7 does.
sdrapkin•2h ago
It's on the roadmap (already implemented in a similar .NET library - https://github.com/sdrapkin/SecurityDriven.FastGuid).
sdrapkin•2h ago
In case you missed it, "guid.Read()" is a much faster alternative to "crypto/rand". https://pkg.go.dev/github.com/sdrapkin/guid#Read
imiric•2h ago
My understanding was that speed is not something you want in a UUID generator, since it makes it more susceptible to brute force attacks. Is this not the case?

I've been using Cuid2[1] in most of my personal projects (this Go implementation[2], actually), which is fast enough, but not "too fast". It's also secure, collision resistant, and has everything I would need from a UUID.

[1]: https://github.com/paralleldrive/cuid2

[2]: https://github.com/nrednav/cuid2

sdrapkin•2h ago
cuid2 generates variable-length strings. If you want fast cryptographically strong string generation, I recommend https://github.com/sdrapkin/randstring. It will likely be faster than cuid2.
imiric•2h ago
That doesn't address what I said. Nor explains why your package is better.
sdrapkin•2h ago
Guid package generates guids/uuids. Your linked package generates variable length strings. These are different usecases (oh, and your benchmarks are inferior to https://github.com/sdrapkin/randstring). Nothing to argue about.
shakna•1h ago
But this doesn't generate guid/uuids? It generates random bytes.
sdrapkin•42m ago
Guid/uuid is defined as a 16-byte structure. Are you questioning the “byte” part, or the “random” part?
imiric•1h ago
No need to argue. You just haven't addressed the point that a fast UUID generator is a security risk. I don't care about benchmarks.

And in most use cases where I'd need a UUID, I'd usually want the string representation of it.

sdrapkin•44m ago
Fast guid/uuid generators are NOT a security risk. You want such generators to be as fast as possible, without compromising cryptographic strength.
saclark11•1h ago
Advertising any UUID/GUID generator as cryptographically secure, or relying on it to be so, is a mistake, in my opinion.

You use a UUID when you need a universally unique ID whose guessability properties are not a critical security requirement. While the V4 UUID spec (which this package does not implement, but most users might assume it does) states that a UUID implementation SHOULD be cryptographically secure [1], it also states that they MUST NOT be used as security capabilities [2]. This is b/c they are not intended as secure tokens, but many users mistakenly assume them to be suitable as such. Not to mention, V4 UUIDs only have 122 bits of entropy, not 128, since 6 bits are reserved for version and variant information, which many users don't realize.

So you can generate a UUID that is suitable as a secure token, but at that point don't call it a UUID. Just call it a secure token. And if you need a secure token, use something like Go's `Text()` function from `crypto/rand` [3].

The situation reminds me of how the Go team updated the `math/rand` and `math/rand/v2` packages to use a CSPRNG as a defensive measure [4], while still urging users to use `crypto/rand` in secure contexts.

[1]: https://www.rfc-editor.org/rfc/rfc9562.html#unguessability

[2]: https://www.rfc-editor.org/rfc/rfc9562.html#Security

[3]: https://pkg.go.dev/crypto/rand@go1.24.5#Text

[4]: https://go.dev/blog/chacha8rand

sdrapkin•52m ago
The vast majority of Golang developers would benefit from using Guid library instead of UUID library. It’s substantially faster in all cases, more secure (by 2^6) and has more functionality.

For random token-as-string generation Golang developers should be using https://github.com/sdrapkin/randstring instead of crypto/rand.Text (faster and more flexible).