Earlier quoted context omitted.
In what world is it safe to rely on an external service to provide GUIDs for you? Where's the guarantee that the service won't one day start manipulating GUIDs? Now you have a major attack vector.
> major attack vector That seems hyperbolic to me. If you rely on UUID for security , it seems, to me, something is wrong in your architecture and the security flaw lies there. When would you, legitimate, rely on GUID/UUID for security?
Show HN: Givemeguid.com – CLI/curl friendly GUIDs
41–50 of 51 posts
Re: Show HN: Givemeguid.com – CLI/curl friendly GUIDs
#42 alias uuid='python -c "import uuid;print(str(uuid.uuid4()))"'Re: Show HN: Givemeguid.com – CLI/curl friendly GUIDs
#43Re: Show HN: Givemeguid.com – CLI/curl friendly GUIDs
#44I'm having trouble imagining who would want to use this. What's the environment where you would have curl and a need for generating UUIDs, but wouldn't have access to uuidgen or similar?
There's no shortage of ways to generate GUIDs, that's for sure!
Re: Show HN: Givemeguid.com – CLI/curl friendly GUIDs
#45If you use Visual Studio, typing the word (with quotes) “nguid” in the code IDE generates one for you.
Re: Show HN: Givemeguid.com – CLI/curl friendly GUIDs
#46Usage information in response headers, me like :)
Re: Show HN: Givemeguid.com – CLI/curl friendly GUIDs
#47If you use Linux: cat /proc/sys/kernel/random/uuid
Re: Show HN: Givemeguid.com – CLI/curl friendly GUIDs
#48I'm having trouble imagining who would want to use this. What's the environment where you would have curl and a need for generating UUIDs, but wouldn't have access to uuidgen or similar?
Re: Show HN: Givemeguid.com – CLI/curl friendly GUIDs
#49If you need a unique identifier on the command line there are a few ways to do it. uuidgen is one. My personal favorite is this snippet. $ id=$(openssl rand 1000 | openssl sha1) && printf "%s${id:0:8}\n"
Re: Show HN: Givemeguid.com – CLI/curl friendly GUIDs
#50Earlier quoted context omitted.
Maybe a JS App which is made completely out of third party APIs, without anything self-hosted? Not discussing wether this is a good idea or not, though... I was surprised to see that there is no "built-in" mechanism in JS to generate a GUID. As a C# dev, I'm used to Guid.NewGuid()
Why would you make an http request if you can just google a 3-line JS solution? You're just generating a large random number and formatting it as a UUID. https://gist.github.com/jed/982883 If you google "generate uuid javascript" you can find approaches from Math.random to node/browser `crypto` module to shelling out OS random. One of the main benefits of guid generation is that you don't need to synchronize with any…
window.crypto.getRandomValues() should be used instead.
The quality and seeding of Math.random() is implementation-dependent and not generally good enough everywhere to prevent collisions. Many seed with the just the system time.
Source: I have personally seen such collisions in a production web app with 700k users. A Web search for “Javacsript GUID collision” shows that many others have as well. We switched to the cryptographic generator and the collisions disappeared.