All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Internal updates to match updated CUID construction logic in the reference
implementation,
specifically:
- Simplified hashing function, no longer adding additional entropy in addition to building a hash
- Increased range of possible values for counter initialization
- Random numbers for entropy are now random numbers from [0, 36), rather than a random choice from a static array of prime numbers
- cuid/cuid2: Moved common utility logic out into a
cuid-util
crate - cuid2: #10: New
is_cuid2
function andis_cuid
alias
- cuid: Replaced base conversion logic in
cuid
with the logic incuid-util
, yielding a solid performance improvement for CUID generation (10-20%) - cuid2: Added
#[inline]
annotations for main cuid2 functions
- cuid: 94d4cd0: Removed unused
bigint
dependency - cuid2: #11: Moved proptest to dev dependencies
- Updated deprecation warnings to mention the
cuid2
crate
- The CUID v1 algorithm is now deprecated,
so all cuid v1 functions have been marked as such. Please use the new
cuid2
crate or thecuid2()
function re-exported from thecuid
crate.
- The CI suite now runs both
cargo clippy
andcargo audit
(edb22b5) - Added nix files for dependency management (8d2c180)
- Added the
cuid2
crate, providing library and binary for v2 of the CUID standard - Added
cuid2()
function in thecuid
crate
- Upgraded to use the Rust 2021 edition (cdc594c)
- Switched from
lazy_static
toonce_cell
(3333dd4) - Added
inline
directive to external functions (8714f67)
1.2.0 - 2021-10-03
- Added
--slug
,--version
, and--help
arguments tocuid
binary (b93b5b3)
- ~10-20% performance improvement overall through optimization of
pad_with_char()
(b5503d6)
1.1.0 - 2021-08-03
- 0-length strings now return
false
when being checked byis_cuid()
rather than panicking (a4fca2f, reported by @DeppLearning)
- Improved specificity of
is_cuid()
andis_slug()
checks (a4fca2f) - Use references for
is_cuid()
andis_slug()
rather than converting to strings (a4fca2f)
1.0.2 - 2021-04-01
- Significant performance improvements for multithreaded usage (~30-35%) due to
the counter now using
AtomicU32
again rather thanArc<Mutex<32>>
, enabled thanks to the stabilization offetch_update
(3a5cc2e) - Generating CUIDs and slugs is now ~15-20% faster, thanks to reductions in the number of allocated strings and improvements to how space is pre-allocated during the generation of radix strings (a09bfad)
- Updated non-v1 requirements to require minor version compatibility
- Updated
rand
requirement from~0.7
to~0.8.0
- Switched from Travis to GH Actions
1.0.1 - 2020-10-01
- Generated CUIDs now have a consistent length, aligning with the reference implementation (#2, thanks @rasendubi!)
1.0.0 - 2020-02-22
- Support for stable Rust (2018 edition)
- The crate now includes a simple binary (
cuid
) that can be used to generate CUIDs on the commandline
- The atomic counter is now an
Arc<Mutex<u32>>
rather than anAtomicUsize
. This change was made to ensure that the counter could be fetched and updated simultaneously without using the nightly-onlyfetch_update
- Updated dependencies
- Ensured documentation examples are run in the test suite
0.1.0 - 2019-02-04
- Initial release
- CUID & CUID slug generation
- Benchmark suite