- Fork fix for #2: the 48-bit
timestamp and the 40-bit random groups are exact when compiled to JavaScript
(dart2js, DDC).
Ulid(),toMillis(),toBase32()andUlid.parseused 32-bit bitwise operators there and lost the high bits; they now use integer arithmetic. Output on the VM and dart2wasm is unchanged.
- Improved performance in various places.
Comparable<Ulid>UlidFactoryfor using customRandomand/or monotonic increments, with customizable options on the monotonic counter's range and randomness.Ulid()constructor will use a Zone-local or falls back to the default factory.
- Fixed minor correctness bugs, invalid ULID string will throw
FormatException. - Added
Ulid.toBase32(): uppercase, spec-aligned 26-character format, with an optionallowercaseparameter. Added a matchinguppercaseparameter toUlid.toUuid(). - Clarified method docs on which format and casing each
toXxx()method emits. Ulid.parsedoc clarifies it accepts both upper- and lowercase input (unchanged behavior).- Deprecated
Ulid.toCanonical()in favor ofUlid.toBase32(); it will be removed in a future major version. - Warning:
Ulid.toString()currently returns the lowercase canonical format, but a future major version will switch it to the uppercasetoBase32()format. CalltoBase32()ortoCanonical()explicitly if your code depends on a specific casing.
- Updated lints and readme.
- Updated lints.
- Migrate to null safety. (#10 by ChristianGaertner)
- Updated code to 2.7 Dart and latest
pedanticlints. - Added
Ulid.toBytesandUlid.fromBytes.
- implement
operator ==andhashCode
- Fixed bit loss in browser's int handling.
- Using
package:pedantic. - Removed leftover
mainmethod.
- Declared support for Dart 2.
- Upgraded dependencies.
- First public version.