Files
memecoin-botV2/.pnpm-store/v10/files/9e/5ddc7cf35b472f05d0ee0e95439aec1e3a88c0feb17f114d640dc16c178286471ad40db9b29cefee7ee0d61270435bd76af9ae09ad0ee917b5851b0577528d

21 lines
630 B
Plaintext

import { unsafeStringify } from './stringify.js';
import v1 from './v1.js';
import v1ToV6 from './v1ToV6.js';
function v6(options, buf, offset) {
options ??= {};
offset ??= 0;
let bytes = v1({ ...options, _v6: true }, new Uint8Array(16));
bytes = v1ToV6(bytes);
if (buf) {
if (offset < 0 || offset + 16 > buf.length) {
throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
}
for (let i = 0; i < 16; i++) {
buf[offset + i] = bytes[i];
}
return buf;
}
return unsafeStringify(bytes);
}
export default v6;