arcway 0.4.5 → 0.4.6
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/package.json +1 -1
- package/server/lib/vault/ids.js +4 -2
package/package.json
CHANGED
package/server/lib/vault/ids.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { customAlphabet
|
|
2
|
+
import { customAlphabet } from 'nanoid';
|
|
3
3
|
|
|
4
|
+
const ALPHANUMERIC_ALPHABET = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
|
4
5
|
const LOWERCASE_BASE32_ALPHABET = 'abcdefghijklmnopqrstuvwxyz234567';
|
|
6
|
+
const alphanumericNanoId = customAlphabet(ALPHANUMERIC_ALPHABET);
|
|
5
7
|
const lowercaseBase32 = customAlphabet(LOWERCASE_BASE32_ALPHABET);
|
|
6
8
|
function generateUUID() {
|
|
7
9
|
return randomUUID();
|
|
8
10
|
}
|
|
9
11
|
function generateNanoId(size) {
|
|
10
|
-
return
|
|
12
|
+
return alphanumericNanoId(size);
|
|
11
13
|
}
|
|
12
14
|
function generateBase32Id(size = 16) {
|
|
13
15
|
return lowercaseBase32(size);
|