2024-01-01 21:11:32 +00:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-05-02 14:51:43 +00:00
|
|
|
// This module is browser compatible.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Name string is a fully-qualified domain name.
|
|
|
|
*
|
2024-05-29 05:47:42 +00:00
|
|
|
* @example Usage
|
2023-05-02 14:51:43 +00:00
|
|
|
* ```ts
|
2024-04-29 02:57:30 +00:00
|
|
|
* import { NAMESPACE_DNS } from "@std/uuid/constants";
|
2024-05-29 05:47:42 +00:00
|
|
|
* import { generate } from "@std/uuid/v5";
|
2023-05-02 14:51:43 +00:00
|
|
|
*
|
2024-05-29 05:47:42 +00:00
|
|
|
* await generate(NAMESPACE_DNS, new TextEncoder().encode("deno.land"));
|
2023-05-02 14:51:43 +00:00
|
|
|
* ```
|
|
|
|
*/
|
|
|
|
export const NAMESPACE_DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
|
|
|
|
/**
|
|
|
|
* Name string is a URL.
|
|
|
|
*
|
2024-05-29 05:47:42 +00:00
|
|
|
* @example Usage
|
2023-05-02 14:51:43 +00:00
|
|
|
* ```ts
|
2024-04-29 02:57:30 +00:00
|
|
|
* import { NAMESPACE_URL } from "@std/uuid/constants";
|
2024-05-29 05:47:42 +00:00
|
|
|
* import { generate } from "@std/uuid/v3";
|
2023-05-02 14:51:43 +00:00
|
|
|
*
|
2024-05-29 05:47:42 +00:00
|
|
|
* await generate(NAMESPACE_URL, new TextEncoder().encode("https://deno.land"));
|
2023-05-02 14:51:43 +00:00
|
|
|
* ```
|
|
|
|
*/
|
|
|
|
export const NAMESPACE_URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
|
|
|
|
/**
|
|
|
|
* Name string is an ISO OID.
|
|
|
|
*
|
2024-05-29 05:47:42 +00:00
|
|
|
* @example Usage
|
2023-05-02 14:51:43 +00:00
|
|
|
* ```ts
|
2024-04-29 02:57:30 +00:00
|
|
|
* import { NAMESPACE_OID } from "@std/uuid/constants";
|
2024-05-29 05:47:42 +00:00
|
|
|
* import { generate } from "@std/uuid/v5";
|
2023-05-02 14:51:43 +00:00
|
|
|
*
|
2024-05-29 05:47:42 +00:00
|
|
|
* await generate(NAMESPACE_OID, new TextEncoder().encode("1.3.6.1.2.1.1.1"));
|
2023-05-02 14:51:43 +00:00
|
|
|
* ```
|
|
|
|
*/
|
|
|
|
export const NAMESPACE_OID = "6ba7b812-9dad-11d1-80b4-00c04fd430c8";
|
|
|
|
/**
|
|
|
|
* Name string is an X.500 DN (in DER or a text output format).
|
|
|
|
*
|
2024-05-29 05:47:42 +00:00
|
|
|
* @example Usage
|
2023-05-02 14:51:43 +00:00
|
|
|
* ```ts
|
2024-04-29 02:57:30 +00:00
|
|
|
* import { NAMESPACE_X500 } from "@std/uuid/constants";
|
2024-05-29 05:47:42 +00:00
|
|
|
* import { generate } from "@std/uuid/v3";
|
2023-05-02 14:51:43 +00:00
|
|
|
*
|
2024-05-29 05:47:42 +00:00
|
|
|
* await generate(NAMESPACE_X500, new TextEncoder().encode("CN=John Doe, OU=People, O=Example.com"));
|
2023-05-02 14:51:43 +00:00
|
|
|
* ```
|
|
|
|
*/
|
|
|
|
export const NAMESPACE_X500 = "6ba7b814-9dad-11d1-80b4-00c04fd430c8";
|
2024-05-16 06:18:08 +00:00
|
|
|
/**
|
|
|
|
* The nil UUID is special form of UUID that is specified to have all 128 bits
|
|
|
|
* set to zero.
|
|
|
|
*/
|
|
|
|
export const NIL_UUID = "00000000-0000-0000-0000-000000000000";
|