cuid2 4.1.0
cuid2: ^4.1.0 copied to clipboard
A dart implementaion of the secure, collision-resistant ids optimized for horizontal scaling and performance (v2).
4.1.0 #
- Migrated
dart:htmltopackage:web(now a dependency). - SDK constraint updated to
>=3.4.0 <4.0.0. - Updated dependencies.
4.0.0 #
- Add CLI (
dart run cuid2orcuid2). - Add
throwIfInsecureoption: when set, throwsUnsupportedErrorif secure RNG is unavailable instead of falling back to non-secureRandom(). - Add optional custom
random(e.g.double Function()) tocuidConfigfor injectable RNG. isCuid: validation now requires first character to be a letter[a-z](per CUID2 spec).cuid/cuidSecure: default length usesCuid.defaultLength;cuidSecureuses secure RNG and rethrowsUnsupportedErrorwhen secure RNG is unavailable.- SDK constraint updated to
>=3.0.0 <4.0.0. - Updated dependencies.
Breaking changes #
cuidConfigfingerprintis nowString?(value), notString Function()?.secureremoved; usethrowIfInsecure: trueto require secure RNG and fail otherwise.
Cuid- Constructor uses named parameters;
fingerprintonCuidinstances is nowString?(usecuid.fingerprintinstead ofcuid.fingerprint!()).
- Constructor uses named parameters;
isCuid- Strings that start with a digit are no longer considered valid.
3.1.0 #
- Fix fingerprinting on web.
- Increase min SDK version from 2.12.0 to 2.14.0.
3.0.0 #
- Refactor code and bring it up to cuid2.js v2.2.0.
- Add more tests.
- [BREAKING]
counterparameter is nowint Function()?instead ofFunction?.
2.0.0 #
-
Add
cuidConfig()for more customizability. -
Example:
Function myCounter(int start) { return () => start += 5; } final cc = cuidConfig(counter: myCounter(0)); final id = cc.gen(); -
[BREAKING] Remove
entropyLengthparam fromcuid()andcuidSecure().
1.0.0 #
- Initial version.