Skip to content

Commit f8d83c8

Browse files
docs(ksuid): update readme w/ v3.0.0 info
BREAKING CHANGE: `epoch` config unified to use milliseconds - add new section to readme - see 3d73b17 for code details
1 parent e879ec6 commit f8d83c8

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

packages/ksuid/README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This project is part of the
1111

1212
- [About](#about)
1313
- [Status](#status)
14+
- [Breaking changes](#breaking-changes)
1415
- [Related packages](#related-packages)
1516
- [Installation](#installation)
1617
- [Dependencies](#dependencies)
@@ -58,6 +59,16 @@ support
5859

5960
[Search or submit any issues for this package](https://github.com/thi-ng/umbrella/issues?q=%5Bksuid%5D+in%3Atitle)
6061

62+
### Breaking changes
63+
64+
Since v3.0.0 all
65+
[`epoch`](https://docs.thi.ng/umbrella/ksuid/interfaces/KSUIDOpts.html#epoch)
66+
time-shift config values are to be given in milliseconds. This change is
67+
unifying this behavior and is only a breaking change if using `KSUID32` and
68+
specifying custom `epoch` offsets (using defaults is **not** impacted).
69+
Previously, `KSUID32` used an offset given in seconds, whereas the other
70+
implementations already used milliseconds.
71+
6172
## Related packages
6273

6374
- [@thi.ng/base-n](https://github.com/thi-ng/umbrella/tree/develop/packages/base-n) - Arbitrary base-n conversions w/ presets for base16/32/36/58/62/64/85, support for arrays & bigints
@@ -84,7 +95,7 @@ For Node.js REPL:
8495
const ksuid = await import("@thi.ng/ksuid");
8596
```
8697

87-
Package sizes (brotli'd, pre-treeshake): ESM: 754 bytes
98+
Package sizes (brotli'd, pre-treeshake): ESM: 769 bytes
8899

89100
## Dependencies
90101

@@ -143,6 +154,8 @@ import { BASE36 } from "@thi.ng/base-n";
143154

144155
// no time shift, 64bit random
145156
const id36 = defKSUID32({ base: BASE36, epoch: 0, bytes: 8 });
157+
158+
id32.next();
146159
// '2VOUKH4K59AG0RXR4XH'
147160
```
148161

packages/ksuid/tpl.readme.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ support
3737

3838
{{meta.status}}
3939

40+
### Breaking changes
41+
42+
Since v3.0.0 all
43+
[`epoch`](https://docs.thi.ng/umbrella/ksuid/interfaces/KSUIDOpts.html#epoch)
44+
time-shift config values are to be given in milliseconds. This change is
45+
unifying this behavior and is only a breaking change if using `KSUID32` and
46+
specifying custom `epoch` offsets (using defaults is **not** impacted).
47+
Previously, `KSUID32` used an offset given in seconds, whereas the other
48+
implementations already used milliseconds.
49+
4050
{{repo.supportPackages}}
4151

4252
{{repo.relatedPackages}}
@@ -105,6 +115,8 @@ import { BASE36 } from "@thi.ng/base-n";
105115

106116
// no time shift, 64bit random
107117
const id36 = defKSUID32({ base: BASE36, epoch: 0, bytes: 8 });
118+
119+
id32.next();
108120
// '2VOUKH4K59AG0RXR4XH'
109121
```
110122

0 commit comments

Comments
 (0)