@anizoptera/uuid-slug 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +315 -1057
- package/dist/alphabet.d.ts +1 -1
- package/dist/alphabet.js +1 -1
- package/dist/base64url-name.d.ts +1 -1
- package/dist/base64url-name.js +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -1
- package/dist/feistel.js +1 -1
- package/dist/generation-options.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/instant.js +1 -1
- package/dist/mask-handle.d.ts +1 -1
- package/dist/mask-handle.js +1 -1
- package/dist/mask.d.ts +1 -1
- package/dist/mask.js +1 -1
- package/dist/masking-codec-protocol.js +1 -1
- package/dist/masking-codec-types.d.ts +1 -1
- package/dist/masking-codec.d.ts +1 -1
- package/dist/masking-codec.js +1 -1
- package/dist/migration.js +1 -1
- package/dist/node/runtime.js +1 -1
- package/dist/payload.d.ts +1 -1
- package/dist/payload.js +1 -1
- package/dist/runtime/pool.js +1 -1
- package/dist/runtime/portable.js +1 -1
- package/dist/sentinel.js +1 -1
- package/dist/siphash.js +1 -1
- package/dist/slug.d.ts +1 -1
- package/dist/slug.js +1 -1
- package/dist/timestamp.d.ts +1 -1
- package/dist/timestamp.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/uuid-value-protocol.js +1 -1
- package/dist/uuid-value.d.ts +1 -1
- package/dist/uuid-value.js +1 -1
- package/dist/uuid.d.ts +1 -1
- package/dist/uuid.js +1 -1
- package/dist/v4-slug.d.ts +1 -1
- package/dist/v4-slug.js +1 -1
- package/dist/v4.d.ts +1 -1
- package/dist/v4.js +1 -1
- package/dist/v7-bounds.d.ts +1 -1
- package/dist/v7-bounds.js +1 -1
- package/dist/v7-generator-input.js +1 -1
- package/dist/v7-generator.d.ts +1 -1
- package/dist/v7-generator.js +1 -1
- package/dist/v7-keyless.d.ts +1 -1
- package/dist/v7-keyless.js +1 -1
- package/dist/v7-payload.js +1 -1
- package/dist/v7-slug.d.ts +1 -1
- package/dist/v7-slug.js +1 -1
- package/dist/v7-timestamp.js +1 -1
- package/dist/v7-value-options.js +1 -1
- package/dist/v7-value.d.ts +1 -1
- package/dist/v7-value.js +1 -1
- package/dist/v7.js +1 -1
- package/package.json +5 -3
- package/src/alphabet.ts +2 -2
- package/src/errors.ts +3 -3
- package/src/feistel.ts +1 -1
- package/src/generation-options.ts +1 -1
- package/src/masking-codec-protocol.ts +1 -1
- package/src/masking-codec.ts +1 -1
- package/src/payload.ts +2 -2
- package/src/runtime/bun.ts +1 -1
- package/src/runtime/node.ts +2 -2
- package/src/runtime/pool.ts +1 -1
- package/src/runtime/portable.ts +1 -1
- package/src/slug.ts +6 -6
- package/src/uuid-value-protocol.ts +1 -1
- package/src/uuid-value.ts +1 -1
- package/src/uuid.ts +8 -8
- package/src/v4.ts +2 -2
- package/src/v7-bounds.ts +3 -3
- package/src/v7-generator-input.ts +2 -2
- package/src/v7-keyless.ts +6 -6
- package/src/v7-payload.ts +1 -1
- package/src/v7-slug.ts +1 -1
- package/src/v7.ts +1 -1
package/dist/alphabet.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { BASE64URL_NAME } from "./base64url-name.js";
|
|
4
4
|
//#region src/alphabet.d.ts
|
|
5
5
|
/** Select lowercase base32hex slug output. */
|
package/dist/alphabet.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_BASE32HEX as e, INVALID_BASE64URL as t, UuidSlugError as n, checkRange as r } from "./errors.js";
|
|
4
4
|
import { BASE64URL_NAME as i } from "./base64url-name.js";
|
|
5
5
|
import { runtime as a } from "#runtime";
|
package/dist/base64url-name.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
//#region src/base64url-name.d.ts
|
|
4
4
|
/** Select unpadded base64url slug output. */
|
|
5
5
|
export declare const BASE64URL_NAME = "base64url";
|
package/dist/base64url-name.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
//#region src/base64url-name.ts
|
|
4
4
|
const e = "base64url";
|
|
5
5
|
//#endregion
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
//#region src/errors.d.ts
|
|
4
4
|
/** The operation was cancelled through its `AbortSignal`. */
|
|
5
5
|
export declare const ABORTED = "aborted";
|
package/dist/errors.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
//#region src/errors.ts
|
|
4
4
|
const e = "aborted", t = "invalid_base32hex", n = "invalid_base64url", r = "invalid_buffer", i = "invalid_mask", a = "invalid_options", o = "invalid_sentinel", s = "invalid_timestamp", c = "invalid_uuid", l = "invalid_uuid_slug", u = "invalid_uuid_version", d = "rng_unavailable", f = "timestamp_outside_window", p = /*#__PURE__*/ Object.freeze([
|
|
5
5
|
e,
|
package/dist/feistel.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
/*#__NO_SIDE_EFFECTS__*/
|
|
4
4
|
function mix32(e) {
|
|
5
5
|
let t = (e ^ e >>> 16) >>> 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_OPTIONS as e, UuidSlugError as t, findUnknownOption as n, isPlainRecord as r } from "./errors.js";
|
|
4
4
|
//#region src/generation-options.ts
|
|
5
5
|
function readGenerationOptions(i, a, o) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { ABORTED, INVALID_BASE32HEX, INVALID_BASE64URL, INVALID_BUFFER, INVALID_MASK, INVALID_OPTIONS, INVALID_SENTINEL, INVALID_TIMESTAMP, INVALID_UUID, INVALID_UUID_SLUG, INVALID_UUID_VERSION, RNG_UNAVAILABLE, TIMESTAMP_OUTSIDE_WINDOW, UuidSlugError, UuidSlugErrorCode, isUuidSlugError } from "./errors.js";
|
|
4
4
|
import { BASE64URL_NAME } from "./base64url-name.js";
|
|
5
5
|
import { BASE32HEX_NAME } from "./alphabet.js";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { ABORTED as e, INVALID_BASE32HEX as t, INVALID_BASE64URL as n, INVALID_BUFFER as r, INVALID_MASK as i, INVALID_OPTIONS as a, INVALID_SENTINEL as o, INVALID_TIMESTAMP as s, INVALID_UUID as c, INVALID_UUID_SLUG as l, INVALID_UUID_VERSION as u, RNG_UNAVAILABLE as d, TIMESTAMP_OUTSIDE_WINDOW as f, UuidSlugError as p, isUuidSlugError as m } from "./errors.js";
|
|
4
4
|
import { BASE64URL_NAME as h } from "./base64url-name.js";
|
|
5
5
|
import { BASE32HEX_NAME as g } from "./alphabet.js";
|
package/dist/instant.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_TIMESTAMP as e, UuidSlugError as t, stringInput as n } from "./errors.js";
|
|
4
4
|
import { MAX_UUID_V7_UNIX_MS as r } from "./v7-timestamp.js";
|
|
5
5
|
//#region src/instant.ts
|
package/dist/mask-handle.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { UuidSlugError } from "./errors.js";
|
|
4
4
|
import { CustomUuidV7MaskOptions, UuidV7Mask } from "./types.js";
|
|
5
5
|
//#region src/mask-handle.d.ts
|
package/dist/mask-handle.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_MASK as e, UuidSlugError as t, findUnknownOption as n, isUint8Array as r, isUuidSlugError as i, stringInput as a } from "./errors.js";
|
|
4
4
|
//#region src/mask-handle.ts
|
|
5
5
|
const o = Symbol.for("@anizoptera/uuid-slug/mask/1"), s = "Custom mask construction failed.", c = "mask", l = {
|
package/dist/mask.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { UuidSlugError } from "./errors.js";
|
|
4
4
|
import { AsyncUuidV7MaskOptions, UuidV7Mask, UuidV7MaskOptions } from "./types.js";
|
|
5
5
|
//#region src/mask.d.ts
|
package/dist/mask.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { ABORTED as e, INVALID_MASK as t, UuidSlugError as n, findUnknownOption as r, isUint8Array as i, stringInput as a } from "./errors.js";
|
|
4
4
|
import { feistel16 as o } from "./feistel.js";
|
|
5
5
|
import { createMaskHandle as s } from "./mask-handle.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
//#region src/masking-codec-protocol.ts
|
|
4
4
|
var ReturnCodec = class {
|
|
5
5
|
constructor(e) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { UuidSlugError } from "./errors.js";
|
|
4
4
|
import { SlugAlphabet } from "./slug.js";
|
|
5
5
|
import { EnabledMigrationFormat, GenerateUuidV7WithMaskedSlugOptions, GeneratedUuidV7, MaskedOrSentinelUuidV7Slug, MaskingCodecUuidInput, ParsedUuidResult, PlainUuidSlug, PlainUuidSlugResult, PlainUuidV7Slug, PlainUuidV7SlugInput, SEEDED_MASK_FORMAT, SlugStringInput, UUID_TEXT_LOWERCASE, Uuid, UuidBytesResult, UuidInput, UuidOutput, UuidSlugMigrationDecoder, UuidSlugMigrationOptions, UuidStringResult, UuidTextCase, UuidTextCaseArguments, UuidV7Bytes, UuidV7Mask, UuidV7MaskOptions, UuidV7MaskingCodecValueOptions, UuidV7Payload, UuidV7PayloadLayout, UuidV7Sentinel, UuidV7SentinelConfig, UuidV7StringFor, UuidV7TimestampWindow, UuidV7ValueInput } from "./types.js";
|
package/dist/masking-codec.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { UuidSlugError } from "./errors.js";
|
|
4
4
|
import { UuidV7MaskingCodec, UuidV7MaskingCodecOptions } from "./masking-codec-types.js";
|
|
5
5
|
//#region src/masking-codec.d.ts
|
package/dist/masking-codec.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_MASK as e, INVALID_OPTIONS as t, INVALID_SENTINEL as n, INVALID_TIMESTAMP as r, INVALID_UUID_VERSION as i, RNG_UNAVAILABLE as a, UuidSlugError as o, checkByteRange as s, exactLocalUuidBytes as c, findUnknownOption as l, isSuccessfulUuidBytes as u, isUint8Array as d, isUuidSlugError as f, normalizeUuidSlugInput as p, stringInput as m } from "./errors.js";
|
|
4
4
|
import { BASE64URL_NAME as h } from "./base64url-name.js";
|
|
5
5
|
import { BASE32HEX_NAME as g } from "./alphabet.js";
|
package/dist/migration.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_OPTIONS as e, INVALID_UUID_SLUG as t, UuidSlugError as n, diagnosticValue as r, findUnknownOption as i, isUuidSlugError as a, normalizeUuidSlugInput as o, stringInput as s } from "./errors.js";
|
|
4
4
|
import { BASE32HEX as c, BASE64URL as l, decodeInto as u, encode as d } from "./alphabet.js";
|
|
5
5
|
import "./types.js";
|
package/dist/node/runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { pooledFill as e } from "../runtime/pool.js";
|
|
4
4
|
import t from "node:crypto";
|
|
5
5
|
import { Buffer as n } from "node:buffer";
|
package/dist/payload.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
//#region src/payload.d.ts
|
|
4
4
|
/** Largest timestamp offset that fits in a masked UUIDv7 payload. */
|
|
5
5
|
export declare const MAX_MASKED_UUID_V7_TIMESTAMP_OFFSET_MS: number;
|
package/dist/payload.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_MASK as e, INVALID_TIMESTAMP as t, INVALID_UUID_SLUG as n, UuidSlugError as r, isUuidSlugError as i } from "./errors.js";
|
|
4
4
|
import { BASE64URL_NAME as a } from "./base64url-name.js";
|
|
5
5
|
import { BASE32HEX as o, BASE64URL as s, decodeInto as c, encode as l, spareBits as u } from "./alphabet.js";
|
package/dist/runtime/pool.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { randomFailure as e } from "../errors.js";
|
|
4
4
|
//#region src/runtime/pool.ts
|
|
5
5
|
const t = 8192;
|
package/dist/runtime/portable.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { RNG_UNAVAILABLE as e, UuidSlugError as t } from "../errors.js";
|
|
4
4
|
import { pooledFill as n } from "./pool.js";
|
|
5
5
|
//#region src/runtime/portable.ts
|
package/dist/sentinel.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
//#region src/sentinel.ts
|
|
4
4
|
function findSentinel(e, t) {
|
|
5
5
|
return e.get(t) ?? (t.length === 26 && e.size !== 0 ? e.get(t.toLowerCase()) : void 0);
|
package/dist/siphash.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
function halfSipHash(e, t, n, r, i, a, o = Infinity) {
|
|
4
4
|
let s = e | 0, c = t ^ 238, l = e ^ 1819895653, u = t ^ 1952801890;
|
|
5
5
|
a && ({v0: s, v1: c, v2: l, v3: u} = a);
|
package/dist/slug.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { UuidSlugError, UuidSlugErrorCode, isUuidSlugError } from "./errors.js";
|
|
4
4
|
import { BASE64URL_NAME } from "./base64url-name.js";
|
|
5
5
|
import { BASE32HEX_NAME } from "./alphabet.js";
|
package/dist/slug.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_OPTIONS as e, INVALID_UUID as t, INVALID_UUID_SLUG as n, INVALID_UUID_VERSION as r, UuidSlugError as i, checkByteRange as a, checkRange as o, exactLocalUuidBytes as s, isUint8Array as c, isUuidSlugError as l, normalizeUuidSlugInput as u, normalizeUuidStringInput as d, stringInput as f, uuidByteView as p } from "./errors.js";
|
|
4
4
|
import { BASE64URL_NAME as m } from "./base64url-name.js";
|
|
5
5
|
import { BASE32HEX as h, BASE32HEX_NAME as g, BASE64URL as _, decodeInto as v, encode as y, isEncoded as b } from "./alphabet.js";
|
package/dist/timestamp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { UuidSlugError } from "./errors.js";
|
|
4
4
|
import { UUID_TEXT_LOWERCASE, UuidTextCase, UuidTextCaseArguments, UuidV7StringFor, UuidV7StringInput, UuidV7TimestampWindow } from "./types.js";
|
|
5
5
|
//#region src/timestamp.d.ts
|
package/dist/timestamp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_TIMESTAMP as e, INVALID_UUID_VERSION as t, TIMESTAMP_OUTSIDE_WINDOW as n, UuidSlugError as r, findUnknownOption as i, normalizeUuidStringInput as a } from "./errors.js";
|
|
4
4
|
import { UUID_TEXT_LOWERCASE as o } from "./types.js";
|
|
5
5
|
import { formatUuidBytesUnchecked as s, isUuidV7Bytes as c, resolveUuidTextCase as l, uuidStringToBytes as u, uuidTimestampFromBytesUnchecked as d } from "./uuid.js";
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { UuidSlugError } from "./errors.js";
|
|
4
4
|
import { SlugAlphabet } from "./slug.js";
|
|
5
5
|
import { UuidV7MaskingCodec, UuidV7MaskingCodecOptions, UuidV7MaskingCodecSharedOptions, UuidV7PreviousMask } from "./masking-codec-types.js";
|
package/dist/types.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
//#region src/types.ts
|
|
4
4
|
const e = "lowercase", t = "uppercase", n = "preserve", r = "reset", i = "error", a = "ncs", o = "rfc", s = "microsoft", c = "future", l = "seeded-mask", u = "fixed-mask", d = "plain-slug";
|
|
5
5
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { isUint8Array as e } from "./errors.js";
|
|
4
4
|
//#region src/uuid-value-protocol.ts
|
|
5
5
|
const t = Symbol.for("@anizoptera/uuid-slug.uuid-value-bytes"), n = Symbol.for("@anizoptera/uuid-slug.uuid-value-context");
|
package/dist/uuid-value.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { UuidSlugError } from "./errors.js";
|
|
4
4
|
import { UuidV7MaskingCodec } from "./masking-codec-types.js";
|
|
5
5
|
import { KeylessUuidInput, ParsedUuidResult, UuidInput } from "./types.js";
|
package/dist/uuid-value.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_OPTIONS as e, INVALID_UUID_VERSION as t, UuidSlugError as n, checkByteRange as r, isUint8Array as i, isUuidSlugError as a } from "./errors.js";
|
|
4
4
|
import { BASE64URL_NAME as o } from "./base64url-name.js";
|
|
5
5
|
import { BASE32HEX as s, BASE64URL as c, encode as l, isEncoded as u } from "./alphabet.js";
|
package/dist/uuid.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { UuidSlugError, UuidSlugErrorCode, isUuidSlugError } from "./errors.js";
|
|
4
4
|
import { PreserveUuidVersion, UUID_TEXT_LOWERCASE, UuidByteInput, UuidBytes, UuidOutput, UuidString, UuidStringFor, UuidStringInput, UuidText, UuidTextCase, UuidTextCaseArguments, UuidV4Bytes, UuidV4String, UuidV4Text, UuidV7Bytes, UuidV7String, UuidV7Text } from "./types.js";
|
|
5
5
|
//#region src/uuid.d.ts
|
package/dist/uuid.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_BUFFER as e, INVALID_OPTIONS as t, INVALID_UUID as n, UuidSlugError as r, checkByteRange as i, checkRange as a, isUint8Array as o, isUuidSlugError as s, normalizeUuidStringInput as c, stringInput as l, uuidByteView as u } from "./errors.js";
|
|
4
4
|
import { UUID_TEXT_LOWERCASE as d } from "./types.js";
|
|
5
5
|
import { runtime as f } from "#runtime";
|
package/dist/v4-slug.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { SlugAlphabet } from "./slug.js";
|
|
4
4
|
import { PlainUuidV4Slug } from "./types.js";
|
|
5
5
|
//#region src/v4-slug.d.ts
|
package/dist/v4-slug.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { generatedOrThrow as e } from "./errors.js";
|
|
4
4
|
import { BASE64URL_NAME as t } from "./base64url-name.js";
|
|
5
5
|
import { encode as n } from "./alphabet.js";
|
package/dist/v4.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { UuidSlugError, UuidSlugErrorCode, isUuidSlugError } from "./errors.js";
|
|
4
4
|
import { UUID_TEXT_LOWERCASE, UuidOutput, UuidRandomFill, UuidTextCase, UuidTextCaseArguments, UuidV4Bytes, UuidV4String, UuidV4StringFor } from "./types.js";
|
|
5
5
|
import { isUuidV4Bytes, isUuidV4String, isUuidV4Text } from "./uuid.js";
|
package/dist/v4.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_OPTIONS as e, RNG_UNAVAILABLE as t, UuidSlugError as n, checkByteRange as r, checkRange as i, fillRandomBytes as a, generatedOrThrow as o, portableAfterNative as s } from "./errors.js";
|
|
4
4
|
import { UUID_TEXT_LOWERCASE as c } from "./types.js";
|
|
5
5
|
import { bytesToUuidString as l, formatUuidBytesUnchecked as u, isUuidTextCase as d, resolveUuidTextCase as f } from "./uuid.js";
|
package/dist/v7-bounds.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { UuidSlugError } from "./errors.js";
|
|
4
4
|
import { UUID_TEXT_LOWERCASE, UuidTextCase, UuidTextCaseArguments, UuidV7Bounds, UuidV7Bytes, UuidV7StringFor } from "./types.js";
|
|
5
5
|
//#region src/v7-bounds.d.ts
|
package/dist/v7-bounds.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_TIMESTAMP as e, UuidSlugError as t } from "./errors.js";
|
|
4
4
|
import { UUID_TEXT_LOWERCASE as n } from "./types.js";
|
|
5
5
|
import { rejectUuidV7UnixMs as r } from "./v7-timestamp.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_OPTIONS as e, INVALID_TIMESTAMP as t, INVALID_UUID_VERSION as n, UuidSlugError as r, checkByteRange as i, isUuidSlugError as a } from "./errors.js";
|
|
4
4
|
import { readUuidV7Instant as o } from "./instant.js";
|
|
5
5
|
import { isUuidV7Bytes as s, uuidTimestampFromBytesUnchecked as c } from "./uuid.js";
|
package/dist/v7-generator.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { UuidSlugError } from "./errors.js";
|
|
4
4
|
import { UuidRandomFill, UuidV7ClockRollbackPolicy, UuidV7Generator } from "./types.js";
|
|
5
5
|
//#region src/v7-generator.d.ts
|
package/dist/v7-generator.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_OPTIONS as e, UuidSlugError as t, findUnknownOption as n, isPlainRecord as r, isSuccessfulUuidBytes as i, stringInput as a } from "./errors.js";
|
|
4
4
|
import "./types.js";
|
|
5
5
|
import { readUuidV7Instant as o } from "./instant.js";
|
package/dist/v7-keyless.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { UuidSlugError } from "./errors.js";
|
|
4
4
|
import { GenerateUuidV7BytesIntoOptions, GenerateUuidV7BytesOptions, GenerateUuidV7Options, UUID_TEXT_LOWERCASE, UuidOutput, UuidTextCase, UuidTextCaseArguments, UuidV7Bytes, UuidV7StringFor } from "./types.js";
|
|
5
5
|
//#region src/v7-keyless.d.ts
|
package/dist/v7-keyless.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { ERROR_MARKER as e, INVALID_TIMESTAMP as t, UuidSlugError as n, fillRandomBytes as r, generatedOrThrow as i, portableAfterNative as a, readClock as o, stringInput as s } from "./errors.js";
|
|
4
4
|
import { readGenerationOptions as c } from "./generation-options.js";
|
|
5
5
|
import { UUID_TEXT_LOWERCASE as l } from "./types.js";
|
package/dist/v7-payload.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_OPTIONS as e, UuidSlugError as t, findUnknownOption as n } from "./errors.js";
|
|
4
4
|
//#region src/v7-payload.ts
|
|
5
5
|
const r = {
|
package/dist/v7-slug.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { UuidSlugError } from "./errors.js";
|
|
4
4
|
import { SlugAlphabet } from "./slug.js";
|
|
5
5
|
import { GeneratePlainUuidV7SlugOptions, GenerateUuidV7WithPlainSlugOptions, GeneratedUuidV7, PlainUuidV7Slug, UUID_TEXT_LOWERCASE, UuidTextCase } from "./types.js";
|
package/dist/v7-slug.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { generatedOrThrow as e, isUuidSlugError as t, portableAfterNative as n, stringInput as r } from "./errors.js";
|
|
4
4
|
import { BASE64URL_NAME as i } from "./base64url-name.js";
|
|
5
5
|
import { BASE64URL as a, encode as o } from "./alphabet.js";
|
package/dist/v7-timestamp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_TIMESTAMP as e, UuidSlugError as t } from "./errors.js";
|
|
4
4
|
//#region src/v7-timestamp.ts
|
|
5
5
|
const n = 0xffffffffffff, isValidUuidV7UnixMs = /* @__NO_SIDE_EFFECTS__ */ (e) => Number.isInteger(e) && e >= 0 && e <= 0xffffffffffff, rejectUuidV7UnixMs = /* @__NO_SIDE_EFFECTS__ */ (r) => /* @__PURE__ */ isValidUuidV7UnixMs(r) ? void 0 : new t(e, `UUIDv7 timestamp must be a whole number of milliseconds in 0..${n}.`);
|
package/dist/v7-value-options.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_OPTIONS as e, UuidSlugError as t, isUuidSlugError as n } from "./errors.js";
|
|
4
4
|
import { readGenerationOptions as r } from "./generation-options.js";
|
|
5
5
|
import { generateUuidV7BytesWithGenerator as i } from "./v7-generator-input.js";
|
package/dist/v7-value.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { UuidSlugError } from "./errors.js";
|
|
4
4
|
import { UuidV7MaskingCodec } from "./masking-codec-types.js";
|
|
5
5
|
import { Uuid, UuidV7ValueOptions } from "./types.js";
|
package/dist/v7-value.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { readUuidV7Generator as e } from "./v7-generator-input.js";
|
|
4
4
|
import { currentUuidV7Bytes as t, uuidV7BytesAt as n, uuidV7DefaultPayloadLayout as r } from "./v7-keyless.js";
|
|
5
5
|
import { createUuidValue as i } from "./uuid-value.js";
|
package/dist/v7.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// @anizoptera/uuid-slug 0.
|
|
2
|
+
// @anizoptera/uuid-slug 0.5.0 | https://github.com/Anizoptera/uuid-slug#readme
|
|
3
3
|
import { INVALID_TIMESTAMP as e, RNG_UNAVAILABLE as t, UuidSlugError as n, checkByteRange as r, checkRange as i, diagnosticValue as a, fillRandomBytes as o, isUint8Array as s, isUuidSlugError as c, readClock as l, stringInput as u } from "./errors.js";
|
|
4
4
|
import { readGenerationOptions as d } from "./generation-options.js";
|
|
5
5
|
import { UUID_TEXT_LOWERCASE as f } from "./types.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anizoptera/uuid-slug",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Zero-dependency UUIDv4/v7 generation, lossless base64url and base32hex slugs for any UUID, and reversible UUIDv7 masking for databases, URLs, and files.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"base32hex",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"imports": {
|
|
41
41
|
"#runtime": {
|
|
42
42
|
"bun": "./src/runtime/bun.ts",
|
|
43
|
-
"deno": "./
|
|
43
|
+
"deno": "./dist/runtime/portable.js",
|
|
44
44
|
"development": {
|
|
45
45
|
"node": "./src/runtime/node.ts",
|
|
46
46
|
"default": "./src/runtime/portable.ts"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
".": {
|
|
54
54
|
"types": "./dist/index.d.ts",
|
|
55
55
|
"bun": "./src/index.ts",
|
|
56
|
-
"deno": "./
|
|
56
|
+
"deno": "./dist/index.js",
|
|
57
57
|
"development": "./src/index.ts",
|
|
58
58
|
"default": "./dist/index.js"
|
|
59
59
|
},
|
|
@@ -64,6 +64,8 @@
|
|
|
64
64
|
"provenance": true
|
|
65
65
|
},
|
|
66
66
|
"engines": {
|
|
67
|
+
"bun": ">=1.0.8",
|
|
68
|
+
"deno": ">=1.29",
|
|
67
69
|
"node": ">=20"
|
|
68
70
|
}
|
|
69
71
|
}
|
package/src/alphabet.ts
CHANGED
|
@@ -367,7 +367,7 @@ export function decodeInto(
|
|
|
367
367
|
// keep the accumulator below for every other byte length, alphabet, and tail width.
|
|
368
368
|
// Fixed paths check every character once after the loop: ORing the codes exposes any code
|
|
369
369
|
// above 127, whose low bits the table read would alias, and ORing the digits turns any -1
|
|
370
|
-
// negative. A branch per character was slower on Node and Bun (bench/
|
|
370
|
+
// negative. A branch per character was slower on Node and Bun (bench/decisions.md).
|
|
371
371
|
if (alpha === BASE64URL && byteLength === 16 && (tailBits === 0 || tailBits === 4)) {
|
|
372
372
|
let codes = 0;
|
|
373
373
|
let digits = 0;
|
|
@@ -491,7 +491,7 @@ export function decodeInto(
|
|
|
491
491
|
}
|
|
492
492
|
|
|
493
493
|
// Fixed 16-byte groups avoid per-character concatenation and temporary text buffers on V8.
|
|
494
|
-
// Bun keeps its Latin-1 writer; remeasure after engine changes (bench/
|
|
494
|
+
// Bun keeps its Latin-1 writer; remeasure after engine changes (bench/decisions.md).
|
|
495
495
|
// Character tables belong to the alphabet owner; callers select only supported tail widths.
|
|
496
496
|
/*#__NO_SIDE_EFFECTS__*/
|
|
497
497
|
function writeBase64url(bytes: Uint8Array, codes: Uint8Array, tail: number): string {
|
package/src/errors.ts
CHANGED
|
@@ -119,12 +119,12 @@ export class UuidSlugError extends Error {
|
|
|
119
119
|
|
|
120
120
|
// One immutable prototype property avoids adding storage to every error while preserving the same
|
|
121
121
|
// marker across realms and duplicate package copies. Remeasure if supported engines change their
|
|
122
|
-
// prototype-property access or Error layout; benchmark evidence belongs in bench/
|
|
122
|
+
// prototype-property access or Error layout; benchmark evidence belongs in bench/decisions.md.
|
|
123
123
|
Object.defineProperty(UuidSlugError.prototype, ERROR_MARKER, { value: true });
|
|
124
124
|
|
|
125
125
|
// Keep local identity before the costlier cross-realm capability, but isolate the probes: a proxy
|
|
126
126
|
// that blocks one operation must not suppress a later independent one. Remeasure if Error branding
|
|
127
|
-
// or inlining changes in a supported engine; results and statistical limits live in
|
|
127
|
+
// or inlining changes in a supported engine; results and statistical limits live in bench/decisions.md.
|
|
128
128
|
/*#__NO_SIDE_EFFECTS__*/
|
|
129
129
|
function hasErrorBrand(candidate: object): boolean {
|
|
130
130
|
try {
|
|
@@ -189,7 +189,7 @@ export function isError(value: unknown): value is Error {
|
|
|
189
189
|
|
|
190
190
|
// A slot probe is the only proof of a genuine buffer, but calling one on anything else
|
|
191
191
|
// throws, and building that native TypeError costs three orders of magnitude more than the checks
|
|
192
|
-
// below (bench/
|
|
192
|
+
// below (bench/decisions.md). For buffers, local identity answers the common case without reading
|
|
193
193
|
// the tag at all; the tag then recognizes another realm's value. The tag is caller-visible, so a value
|
|
194
194
|
// carrying its own Symbol.toStringTag still reaches the probe and keeps its acceptance, and that
|
|
195
195
|
// own-property lookup runs only after the tag misses. Only a value whose realm re-tagged the
|
package/src/feistel.ts
CHANGED
|
@@ -70,7 +70,7 @@ export function feistel16(
|
|
|
70
70
|
const key = (direction === "mask" ? round : ROUNDS - 1 - round) * 2;
|
|
71
71
|
// The round function is `halfSipHash(keys[key], keys[key + 1], [right0, right1], 8)`, written
|
|
72
72
|
// out for its fixed two-word message: the call through word arrays cost about a fifth more of
|
|
73
|
-
// the network on Node and Bun (bench/
|
|
73
|
+
// the network on Node and Bun (bench/decisions.md). The fixed vector in `feistel.test.ts`
|
|
74
74
|
// and the wire-format vectors hold it to issued slugs.
|
|
75
75
|
const key0 = keys[key] as number;
|
|
76
76
|
const key1 = keys[key + 1] as number;
|
|
@@ -28,7 +28,7 @@ export function readGenerationOptions(
|
|
|
28
28
|
return new UuidSlugError(INVALID_OPTIONS, `Unknown ${operation} option: ${unknown}.`);
|
|
29
29
|
const source = options as GenerationOptionValues;
|
|
30
30
|
// Direct assignments build one object; a conditional spread per option allocated a temporary
|
|
31
|
-
// object for each (bench/
|
|
31
|
+
// object for each (bench/decisions.md). Each accepted own property is read once, in this
|
|
32
32
|
// order. Callers resolve `alphabet` and `textCase`, which also unwraps `String` objects.
|
|
33
33
|
const values: { -readonly [Key in keyof GenerationOptionValues]: unknown } = {};
|
|
34
34
|
if (accepted.alphabet && Object.hasOwn(source, "alphabet")) values.alphabet = source.alphabet;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Only this package's frozen codecs may borrow private UUID storage. Structural callbacks can
|
|
4
4
|
// retain or mutate their input; public shape checks cannot establish ownership.
|
|
5
5
|
// A private stamp follows the generator ownership protocol without a WeakSet registration or lookup;
|
|
6
|
-
// construction and conversion measurements are owned by bench/
|
|
6
|
+
// construction and conversion measurements are owned by bench/decisions.md.
|
|
7
7
|
// Remeasure construction and parsed conversions if engines change private-field storage.
|
|
8
8
|
// eslint-disable-next-line typescript/no-extraneous-class -- returning the codec lets the subclass stamp the existing plain object
|
|
9
9
|
class ReturnCodec {
|