Commit Graph

21 Commits

Author SHA1 Message Date
moznion 5701df6096
Fix typos in Javadoc of Ulid class
Signed-off-by: moznion <moznion@mail.moznion.net>
2023-08-18 16:21:57 -07:00
Fabio Lima 7e7e3c496c [chore] regular maintenance 2023-07-23 16:07:24 -03:00
Fabio Lima 6641297be8 regular maintenance 2023-04-30 03:49:39 -03:00
Fabio Lima 1a7f97438a regular maintenance 2023-04-30 02:34:28 -03:00
Fabio Lima 36855d4b99 regular maintenance 2023-04-26 03:36:14 -03:00
Fabio Lima fc31807789 regular maintenance 2023-04-26 03:13:34 -03:00
Fabio Lima 41c15148d3 Add a MIN and MAX constants and methods 2023-04-25 23:30:07 -03:00
Fabio Lima ebc145f52a Add a fast method to generate identifiers 2022-10-22 15:02:37 -03:00
Fabio Lima fbe1338ce9 Rewrite docs 2022-09-17 09:56:07 -03:00
Fabio Lima 3f56210b53 Optimize comparison and hash 2022-08-21 07:24:10 -03:00
Fabio Lima 745bd55ffc feat: handle clock drift
Added drift tolerance of 10 seconds to preserve monotonicity when the
system clock is adjusted by NTP after a small clock drift or when the
system clock jumps back by 1 second due to leap second.

The random component is incremented when the current time:
- is the same as the previous time;
- has moved backwards up to 10 seconds.

The time component is also incremented if the random component is
exceeded, which is quite rare.
2022-04-21 14:53:06 -03:00
Fabio Lima 8a5fc3d093 regular maintenance 2021-12-11 14:04:34 -03:00
Fabio Lima ced08d1a55 Compare internal fields as unsigned integers 2021-11-06 10:06:14 -03:00
Fabio Lima 27a4f60cb5 Version 4.0.0
Now you call `UlidFactory.newInstance()` and it's variants to get a new
`UlidFactory`.

List of changes:

- Added `UlidFactory.newInstance()`
- Added `UlidFactory.newInstance(Random)`
- Added `UlidFactory.newInstance(Supplier<byte[]>)`
- Added `UlidFactory.newMonotonicInstance()`
- Added `UlidFactory.newMonotonicInstance(Random)`
- Added `UlidFactory.newMonotonicInstance(Supplier<byte[]>)`
- Added benchmark code to compare ULID with UUID
- Removed `DefaultFactory`
- Removed `MonotonicFactory`
- Removed `Ulid.toUpperCase()`
- Removed `RandomGenerator`
2021-08-08 01:35:40 -03:00
Fabio Lima 0f431d01b1 Add constructors in UlidFactory for random generators
New constructors:

- public UlidFactory(Random random) { }
- public UlidFactory(RandomGenerator randomGenerator) { }
2021-07-18 01:21:41 -03:00
Fabio Lima 1dffbf1ebb Add static methods for extracting time and random components
Add static methods to Ulid:
 - Ulid.getInstant(String);
 - Ulid.getTime(String);
 - Ulid.getRandom(String);

List of changes:

Updated Ulid
Updated test cases
Updated README.md

Test coverage 99.4%
2021-02-13 20:14:31 -03:00
Fabio Lima 3f10989f74 [maven-release-plugin] prepare for next development iteration 2021-02-04 02:06:28 -03:00
Fabio Lima f1eaebd3bd Development of version 3.0.0
continuing...

List of changes:

Improve Ulid
Create UlidFactory
Create DefaultUlidFactory
Create MonotonicUlidFactory
Improve UlidTest
Create UlidFactoryTest
Create DefaultUlidFactoryTest
Create MonotonicUlidFactoryTest
Update UniquenessTest
Update README.md
Update javadoc

Test coverage: 99.3%
2021-01-30 07:17:09 -03:00
Fabio Lima 3aa29be465 Development of version 3.0.0
Continuing...

Improve Ulid
Simplify UlidSpecCreator
Simplify MonotonicUlidSpecCreator
Remove OtherRandomStrategy
Remove UlidValidator
Update test cases
2021-01-25 02:19:08 -03:00
Fabio Lima ef2842bfe8 Development of version 3.0.0
Continuing...

List of changes:

Improved Ulid
Improved UlidCrator
Improved UlidSpecCreator
Improved DefaultUlidSpecCreator
Improved MonotonicUlidSpecCreator
Removed TimestampStrategy
Removed DefaultTimestampStrategy
Removed FixedTimestampStrategy
Updated testa cases
2021-01-24 16:33:11 -03:00
Fabio Lima 2ffa7a95dd Development of version 3.0.0
Changed the uuid-creator to generate two types of ULID: default
(non-monotonic) and monotonic.

Until version 2.x.x this library only created monotonic ULIDs.

The version 3.0.0 breaks compatibility.

List of changes:

Changed UlidCreator
Created Ulid
Created UlidSpecCreator // abstract
Created DefaultUlidSpecCreator // implementation
Created MonotonicUlidSpecCreator // implementation
Removed UlidConverter
Removed UlidUtil
Removed UlidStruct
Create and update test cases
and more...

Test coverage: 93.5%
2021-01-24 00:08:24 -03:00