/** * Copyright 2026 Angus.Fenying * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * The options for the UUIDv5 generator. */ export type IUuid5Options = Pick; /** * The pre-defined namespaces for UUIDv5. */ export declare enum EUuid5PredefinedNamespaces { DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8", OID = "6ba7b812-9dad-11d1-80b4-00c04fd430c8", X500 = "6ba7b814-9dad-11d1-80b4-00c04fd430c8" } /** * The class for generating UUID in version 5. */ export declare class Uuid5Generator { /** * The namespace of the UUID, which must be a UUID string. */ readonly namespace: string; private readonly _nsBin; /** * Create a UUIDv5 generator bound to the specified namespace. * * @param opts The options for the UUIDv5 generator. */ constructor(opts: IUuid5Options); /** * Generate a UUIDv5 based on the namespace and the name. * * @param name The name to generate the UUID from. * * @returns A UUIDv5 string. */ generate(name: string): string; /** * Generate a UUIDv5 based on the namespace and the name, and return it as a Buffer. * * @param name The name to generate the UUID from. * * @returns A UUIDv5 in Buffer format, which is 16 bytes in total. */ generateAsBuffer(name: string): Buffer; /** * Generate a UUIDv5 based on the provided namespace and name. * * @param namespace The namespace for the UUID, which must be a UUID string or a Buffer of 16 bytes. * @param name The name to generate the UUID from. * @returns A UUIDv5 string. */ static generate(namespace: string | Buffer, name: string): string; /** * Generate a UUIDv5 based on the provided namespace and name, and return it as a Buffer. * * @param namespace The namespace for the UUID, which must be a UUID string or a Buffer of 16 bytes. * @param name The name to generate the UUID from. * @returns A UUIDv5 in Buffer format, which is 16 bytes in total. */ static generateAsBuffer(namespace: string | Buffer, name: string): Buffer; } //# sourceMappingURL=UUIDv5.d.ts.map