std/uuid/constants.ts

57 lines
1.6 KiB
TypeScript
Raw Normal View History

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.
/**
* Name string is a fully-qualified domain name.
*
2024-05-29 05:47:42 +00:00
* @example Usage
* ```ts
* import { NAMESPACE_DNS } from "@std/uuid/constants";
2024-05-29 05:47:42 +00:00
* import { generate } from "@std/uuid/v5";
*
2024-05-29 05:47:42 +00:00
* await generate(NAMESPACE_DNS, new TextEncoder().encode("deno.land"));
* ```
*/
export const NAMESPACE_DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
/**
* Name string is a URL.
*
2024-05-29 05:47:42 +00:00
* @example Usage
* ```ts
* import { NAMESPACE_URL } from "@std/uuid/constants";
2024-05-29 05:47:42 +00:00
* import { generate } from "@std/uuid/v3";
*
2024-05-29 05:47:42 +00:00
* await generate(NAMESPACE_URL, new TextEncoder().encode("https://deno.land"));
* ```
*/
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
* ```ts
* import { NAMESPACE_OID } from "@std/uuid/constants";
2024-05-29 05:47:42 +00:00
* import { generate } from "@std/uuid/v5";
*
2024-05-29 05:47:42 +00:00
* await generate(NAMESPACE_OID, new TextEncoder().encode("1.3.6.1.2.1.1.1"));
* ```
*/
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
* ```ts
* import { NAMESPACE_X500 } from "@std/uuid/constants";
2024-05-29 05:47:42 +00:00
* import { generate } from "@std/uuid/v3";
*
2024-05-29 05:47:42 +00:00
* await generate(NAMESPACE_X500, new TextEncoder().encode("CN=John Doe, OU=People, O=Example.com"));
* ```
*/
export const NAMESPACE_X500 = "6ba7b814-9dad-11d1-80b4-00c04fd430c8";
/**
* 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";