main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
464 bytes
|
Line | |
---|
1 | import { unsafeStringify } from './stringify.js';
|
---|
2 | import v1 from './v1.js';
|
---|
3 | import v1ToV6 from './v1ToV6.js';
|
---|
4 | function v6(options, buf, offset) {
|
---|
5 | options ??= {};
|
---|
6 | offset ??= 0;
|
---|
7 | let bytes = v1({ ...options, _v6: true }, new Uint8Array(16));
|
---|
8 | bytes = v1ToV6(bytes);
|
---|
9 | if (buf) {
|
---|
10 | for (let i = 0; i < 16; i++) {
|
---|
11 | buf[offset + i] = bytes[i];
|
---|
12 | }
|
---|
13 | return buf;
|
---|
14 | }
|
---|
15 | return unsafeStringify(bytes);
|
---|
16 | }
|
---|
17 | export default v6;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.