question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support nil or empty uuid

See original GitHub issue

Is your feature request related to a problem? Please describe.

I wanted to go ahead and make a PR for adding nil uuid which is a special case. Before doing the work, I just wanted to double check to see if this has been considered before or there are any objections to it.

You can read more about nil uuid https://en.wikipedia.org/wiki/Universally_unique_identifier#Nil_UUID

Describe the solution you’d like

I was thinking about adding nill to the namespace so the user can write the following code:

import { nil } from 'uuid';
console.log(nil()); // => '00000000-0000-0000-0000-000000000000'

I believe that is valid for all versions, so we dont need to implement it under v1, v2, etc. Let me know your thoughts and I’ll get to it.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
IsaiahJTurnercommented, Jul 17, 2020

I don’t have any opinions on this feature but just saw the issue and wanted to share a nil uuid use case from: https://developer.apple.com/documentation/adsupport/asidentifiermanager/1614151-advertisingidentifier

The advertisingIdentifier is an alphanumeric string unique to each device, that you only use for advertising. Specific uses are for frequency capping, attribution, conversion events, estimating the number of unique users, advertising fraud detection, and debugging. The advertising identifier has a value of 00000000-0000-0000-0000-000000000000 until authorization is granted or when using the Simulator.

So, there are a lot of client’s which do conditional logic on the backend to handle it. Why Apple does this perplexes me but they do.

1reaction
ali92hmcommented, Jul 27, 2020

Yes, I was able to make the following work

console.log(uuid.NIL)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Instance of an empty ("nil") UUID in Java - Stack Overflow
Constructor. Use the constructor taking a pair of long integers, both zero. java.util.UUID uuid = new UUID( 0 , 0 ); // Or...
Read more >
UUID always nil | Apple Developer Forums
Hi,. In my Mac OS app I'm trying to create an UUID from a string. the code is taken straight from the documentation...
Read more >
Your Nil/Empty UUID - Online UUID Generator
Quickly and easily generate individual or bulk sets of universally unique identifiers (UUIDs).
Read more >
UUID 'null' becomes '00000000-0000-0000 ... - Google Groups
Hello everybody, I found something that seems to be illogically to me. My database uses UUIDs as primary and foreign keys. The software...
Read more >
"Not a valid UUID" on nil UUID - Help me!
Observed behavior The FA front end does not accept the nil UUID as a valid UUID ... For you to know, you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found