2020-10-01 05:40:40 -04:00
|
|
|
// Based on https://github.com/kelektiv/node-uuid -> https://www.ietf.org/rfc/rfc4122.txt
|
|
|
|
// Supporting Support for RFC4122 version 1, 4, and 5 UUIDs
|
2020-01-02 15:13:47 -05:00
|
|
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
2020-04-15 19:08:05 +04:30
|
|
|
import * as v1 from "./v1.ts";
|
2019-12-23 17:36:25 +08:00
|
|
|
import * as v4 from "./v4.ts";
|
2020-04-27 20:49:34 +08:00
|
|
|
import * as v5 from "./v5.ts";
|
2019-07-03 08:13:22 -07:00
|
|
|
|
|
|
|
export const NIL_UUID = "00000000-0000-0000-0000-000000000000";
|
|
|
|
|
2020-10-01 05:40:40 -04:00
|
|
|
/**
|
|
|
|
* Checks if UUID is nil
|
|
|
|
* @param val UUID value
|
|
|
|
*/
|
2019-07-03 08:13:22 -07:00
|
|
|
export function isNil(val: string): boolean {
|
|
|
|
return val === NIL_UUID;
|
|
|
|
}
|
|
|
|
|
2020-04-27 20:49:34 +08:00
|
|
|
export { v1, v4, v5 };
|