Skip to content

Support nil or empty uuid #475

@ali92hm

Description

@ali92hm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions