Comparing version 0.3.1 to 0.3.2
@@ -660,2 +660,13 @@ /** | ||
*/ | ||
export const scru64String = async () => (await scru64()).toString(); | ||
export const scru64String = async () => { | ||
const DELAY = 64; | ||
while (true) { | ||
const value = GlobalGenerator.generate(); | ||
if (value !== undefined) { | ||
return value.toString(); | ||
} | ||
else { | ||
await new Promise((resolve) => setTimeout(resolve, DELAY)); | ||
} | ||
} | ||
}; |
{ | ||
"name": "scru64", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "SCRU64: Sortable, Clock-based, Realm-specifically Unique identifier", | ||
@@ -9,2 +9,3 @@ "type": "module", | ||
"exports": "./dist/index.js", | ||
"bin": "./cli.js", | ||
"files": [ | ||
@@ -11,0 +12,0 @@ "dist" |
@@ -41,2 +41,14 @@ # SCRU64: Sortable, Clock-based, Realm-specifically Unique identifier | ||
## Command-line interface | ||
```bash | ||
$ SCRU64_NODE_SPEC=42/8 npx scru64 | ||
0uc3xnefo50h | ||
$ SCRU64_NODE_SPEC=42/8 npx scru64 -n 4 | ||
0uc3xnl3eas9 | ||
0uc3xnl3easa | ||
0uc3xnl3easb | ||
0uc3xnl3easc | ||
``` | ||
## License | ||
@@ -43,0 +55,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57574
6
1088
61