Releases: mplanchard/cuid-rust
cuid v2.0.1
cuid v2.0.1
Note that starting with this release, releases on GH will only be made
for the main cuid crate. Tags will still be created for both cuid
and the cuid1 and cuid2 subcrates, though.
cuid2 v0.1.6
Changed
- 15-20% performance improvement for cuid2 generation, due mostly to
optimizations increate_entropy(), along with a few other smaller
optimizations
cuid v2.0.0
This release contains breaking changes, specifically the removal of functions
that were previously marked as deprecated. Please see the notes below for details.
Removed
-
The top-level
cuid(),slug(), andis_cuid()functions have been
removed. These were implicitly yielding v1 CUIDs, and it is now required
for CUID version to be explicitly specified.Importing
cuid::v1::*or qualifying each function likev1::cuid()is
equivalent to the removed top-level functions.In addition, version-specific top-level function names like
cuid1(),
cuid1_slug(), andis_cuid1()are provided.
This release also pulls in the following releases of the cuid1 and cuid2
subpackages:
- https://github.com/mplanchard/cuid-rust/releases/tag/cuid1-v0.1.1
- https://github.com/mplanchard/cuid-rust/releases/tag/cuid2-v0.1.5
These are both patch releases, with no interface-level changes.
cuid2 v0.1.5
Changed
- Updated a variety of dependencies, Rust edition, and so on.
- Updated transitive dependency specification for
getrandomto
current version, resolves #19
cuid1 v0.1.1
Changed
- Updated a variety of dependencies, Rust edition, and so on.
- Updated transitive dependency specification for
getrandomto
current version, resolves #19
cuid2 v0.1.4
cuid2 v0.1.4
Fixed
- Replaced
std::sys::SystemTimewithweb_time::SystemTimeso that
CUID generation does not panic in WASM builds.
cuid1 v0.1.0
cuid1 v0.1.0
Technically, this is a new crate! This was published containing the
fix below. This will be included in the next major version of cuid,
which will be a breaking release in which the top-level cuid() function
is replaced by explicit calls to either cuid1() or cuid2().
Fixed
- (v1) Replaced
std::sys::SystemTimewithweb_time::SystemTimeso
that CUID generation does not panic in WASM builds
cuid v1.3.3, cuid2 v0.1.3
cuid2 v0.1.3, cuid 1.3.3
Upcoming
- The next major release will be a breaking release, dropping the
top-levelcuid(),slug(), andis_cuid()functions in favor of
their version-specific counterparts (see below). - I also intend to split the v1 CUID functionality out into its own
crate and publish it independently, like I have done forcuid2.
The top-levelcuidcrate will then pull in the sub-crates depending
on features, making it easy to just pull the CUID version you need.
Added
- Provide new top-level functions from the
cuidlibrary to disambiguate
CUID versions:cuid::cuid1(): generate a v1 CUID, replacement for deprecatedcuid()cuid::cuid1_slug(): generate a v1 CUID slug, replacement for deprecatedslug()cuid::is_cuid1()- check whether a string looks like it could be a v1 CUID,
replacement for deprecatedis_cuid()cuid::is_cuid1_slug()- check whether a string looks like it could be a v1 CUID
slug, replacement for deprecatedis_cuid()cuid::cuid2_slug()- generate a v2 CUID of length 10cuid::is_cuid2_slug()- check whether a string looks like could be a v2 CUID
slugcuid::Cuid2Constructor- expose the v2 CUID constructor interface
- Added a couple of functions to
cuid2for parity with v1 functions:cuid2::slug()- generate a v2 CUID of length 10cuid2::is_slug()- check whether a string looks like could be a v2 CUID
slug
- Added support for webassembly builds. Builds are tested for
wasm32-unknown-unknown
andwasm32-wasitargets. I intend to add Javascript bindings and publish
npm packages in an upcoming update.- The system hostname is not available to WASM, so for the CUID v1
fingerprint algorithm, we instead use a v4 UUID. This does mean the
fingerprint will not be consistent on a host over time, which slightly
diverges from the behavior of CUIDs on other targets. Please open an
issue if this is a problem for you.
- The system hostname is not available to WASM, so for the CUID v1
Changed
- CUID v1 functions are no longer marked as deprecated. The original JS
library was marked as insecure and deprecated by its creators, but this
was merely due to their personal stance that any k-sortable IDs are
insecure and should not be used. This library's author does not share
the same view. New functions have been provided to better disambiguate
creating v1 vs v2 IDs, and functions that do not explicitly specify
a version are still marked as deprecated. - The CUID binaries now randomize the counter prior to generating an ID,
rather than always starting at 0. This ensures that commandline-generated
CUIDs do not lose entropy relative to library-generated CUIDs due to
always having the same counter value. - The
cuid2::is_cuid()/cuid::is_cuid2()function has been improved and
now rejects more strings that are invalid CUIDs (contribution by @stormshield-kg) - The
cuid2binary now supports an optional--length|-largument, which
enables specifying the length of the generated CUID (contribution by @der-fruhling)
Removed
- Removed old benchmarks and
#[cfg(nightly)]blocks. Criterion benchmarks
are the important ones, and those remain.
cuid2 v0.1.2
cuid2 v0.1.2
Changed
- 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
- Simplified hashing function, no longer adding additional entropy in addition
cuid2-v0.1.1
cuid 1.3.2, cuid2 0.1.1
Added
- cuid/cuid2: Moved common utility logic out into a
cuid-utilcrate - cuid2: #10: New
is_cuid2function andis_cuidalias
Changed
- cuid: Replaced base conversion logic in
cuidwith the logic incuid-util,
yielding a solid performance improvement for CUID generation (10-20%) - cuid2: Added
#[inline]annotations for main cuid2 functions
Fixed
cuid-v1.3.2
cuid 1.3.2, cuid2 0.1.1
Added
- cuid/cuid2: Moved common utility logic out into a
cuid-utilcrate - cuid2: #10: New
is_cuid2function andis_cuidalias
Changed
- cuid: Replaced base conversion logic in
cuidwith the logic incuid-util,
yielding a solid performance improvement for CUID generation (10-20%) - cuid2: Added
#[inline]annotations for main cuid2 functions