• Generate a RFC4122 v5 UUID (SHA-1 namespace).

    import uuidv5 from "uuidv5";

    const NAMESPACE_URL = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
    const data = new TextEncoder().encode("example.org")

    const uuid = uuidv5.generate(NAMESPACE_URL, data);
    uuid === "886313e1-3b8a-5372-9b90-0c9aee199e5d" // true

    Returns

    uuid

    Parameters

    • namespace: string

      The namespace to use, uuid valid

    • data: Uint8Array

      The data to hash to calculate the SHA-1 digest for the UUID

    Returns string

Generated using TypeDoc