Files
klz-cables.com/.pnpm-store/v10/files/25/fec6c5b9c65a46810b9c04a645341279d8123c90d02e6a7922d052efe59a0a9770caf577d210634658e4e498b7eed7ff9bb7935a6f66d4cfaf8a55e3527332
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

32 lines
817 B
Plaintext

import { unsafeStringify } from './stringify.js';
import v1 from './v1.js';
import v1ToV6 from './v1ToV6.js';
/**
*
* @param {object} options
* @param {Uint8Array=} buf
* @param {number=} offset
* @returns
*/
export default function v6(options = {}, buf, offset = 0) {
// v6 is v1 with different field layout, so we start with a v1 UUID, albeit
// with slightly different behavior around how the clock_seq and node fields
// are randomized, which is why we call v1 with _v6: true.
let bytes = v1({
...options,
_v6: true
}, new Uint8Array(16));
// Reorder the fields to v6 layout.
bytes = v1ToV6(bytes);
// Return as a byte array if requested
if (buf) {
for (let i = 0; i < 16; i++) {
buf[offset + i] = bytes[i];
}
return buf;
}
return unsafeStringify(bytes);
}