Releases: puid/Elixir
2.7.1
v2.7.0
Puid 2.6.0
What's Changed
New Features
- Exposed
Puid.Chars.metrics/1function as public API
Puid.Chars.metrics(:alpha)
%{
avg_bits: 6.769230769230769,
bit_shifts: [{51, 6}, {55, 4}, {63, 3}],
ere: 0.7125549647676365,
ete: 0.8421104129072068
}
- Added 11 new predefined character sets (total now 31, up from 20):
:base36and:base36_upper- Case-insensitive alphanumeric:base45- QR code alphanumeric mode:base62- Alias for:alphanum:base85- ASCII85 encoding:bech32- Bitcoin SegWit address encoding:boolean- Binary with 'TF':dna- DNA nucleotides 'ACGT':geohash- Geographic coordinate encoding:url_safe- RFC 3986 unreserved characters:z_base32- Zooko's base32
Full Changelog: 2.5.0...2.6.0
Release 2.5.0
What's New
Added
-
Entropy Transform Efficiency (ETE) support
Puid.Chars.ete/1function for calculating ETE of charsetsPuid.Chars.predefined/0function to dynamically list predefined charset atomsetefield toPuid.Infostructure showing Entropy Transform Efficiency- Comprehensive ETE benchmarks comparing Puid with other ID generation libraries
- ETE analysis scripts showing theoretical vs empirical efficiency
- Updated README for ETE and ERE
-
New base58 predefined charset
- Uses Bitcoin base58 alphabet (excludes 0, O, I, l to avoid confusion)
- 58 characters with ~5.86 bits per character
- ETE of 0.91 (91% efficiency)
Changes
- Minimum Elixir version bumped to 1.15 (from 1.14)
- Updated CI matrix to reflect new minimum version
Installation
Add to your mix.exs dependencies:
{:puid, "~> 2.5"}Example Usage
Using the new base58 charset:
defmodule Base58Id do
use Puid, chars: :base58
end
Base58Id.generate()
# => "vRxen9A4vejoX4U66iaHna"Getting ETE information:
Puid.Chars.ete(:base58)
# => %{ete: 0.91, expected_bits: 6.45, ...}Full Changelog
See CHANGELOG.md for complete details.
Release 2.4.0
What's New
Changes
- Unified entropy approximations for
bits/2,total/2andrisk/2(removed small-total branch) - Simplified README Comparisons with added Benchee usage instructions
Added
- Benchee benchmark:
bench/compare.exs(Puid-only and full comparison modes) - GitHub Actions CI workflow: matrix build/test and dialyzer
Fixed
- Typespec consistency: non-bang functions now return
{:error, String.t()}; bang variants raisePuid.Error - Test bug fix: Fixed test bug in decode/encode roundtrip (use EDAscii correctly)
- Info spec:
info/0spec now returnsPuid.Info.t(); addedPuid.Info.ttype
Tooling Improvements
- Mix project: Renamed to
Puid.MixProject; addedstart_permanent, docs extras, dialyzer flags, preferred_cli_env, package files - Added Credo and
.credo.exs - Updated dependencies:
ex_doc ~> 0.38,dialyxir 1.4.6 - Removed
test/timing.exs; use Benchee for performance comparisons
Installation
Add to your mix.exs dependencies:
{:puid, "~> 2.4"}Full Changelog
See CHANGELOG.md for complete details.
Released: 2025-08-29
2.3.2
2.3.1
Puid 2.3
Puid 2.3 adds four functions to Puid generated modules:
- total: total puids which can be generated at a specified
risk - risk: risk in generating a specified
totalpuids - encode: encode a
bitstringto a puid - decode: decode a
puidinto the representative bitstring
total and risk are useful for after-the-fact considerations. You created a puid generator, and now want to know:
- with this generator, what is the risk of repeat if I generate
totalpuids - with this generator, what is the total number of puids I can generate at some
risk
encode and decode were added to facilitate the creation of an ecto-puid package that allows Puid generation for DB ids. These function are not robust. They expect to be used with Puid generated values, and as such those values must be valid with respect to the Puid generator in use.
Puid 2.2
Puid 2.1
Puid 2.1 implements a minor optimization in bit slicing that does not change general external functionality. The change could effect the results of testing with fixed byte input for puid generation, and therefore warranted a minor version update to alert any user that used fixed byte entropy input for testing purposes.