Skip to content

Releases: puid/Elixir

2.7.1

13 Jan 14:14

Choose a tag to compare

Fix

  • Fix bit shift pattern matching in Puid.Bits by using pin operator for bit size

v2.7.0

18 Oct 18:06

Choose a tag to compare

Added

  • Support for Elixir 1.19
  • Added :word_safe32 as new preferred atom for word-safe character set

Changed

  • Fixed preferred_cli_env deprecation warning by moving to cli/0 function

Deprecated

  • :wordSafe32 atom is deprecated in favor of :word_safe32

Puid 2.6.0

05 Sep 16:20

Choose a tag to compare

What's Changed

New Features

  • Exposed Puid.Chars.metrics/1 function 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):
    • :base36 and :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

01 Sep 19:17

Choose a tag to compare

What's New

Added

  • Entropy Transform Efficiency (ETE) support

    • Puid.Chars.ete/1 function for calculating ETE of charsets
    • Puid.Chars.predefined/0 function to dynamically list predefined charset atoms
    • ete field to Puid.Info structure 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

01 Sep 19:19

Choose a tag to compare

What's New

Changes

  • Unified entropy approximations for bits/2, total/2 and risk/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 raise Puid.Error
  • Test bug fix: Fixed test bug in decode/encode roundtrip (use EDAscii correctly)
  • Info spec: info/0 spec now returns Puid.Info.t(); added Puid.Info.t type

Tooling Improvements

  • Mix project: Renamed to Puid.MixProject; added start_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

24 Dec 18:15

Choose a tag to compare

Fix Elixir 1.18 Range warning by explicitly declaring downward stepping

2.3.1

24 Dec 18:15

Choose a tag to compare

Minor mods for deprecations raised by Elixir 1.17

Puid 2.3

21 Nov 17:57

Choose a tag to compare

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 total puids
  • encode: encode a bitstring to a puid
  • decode: decode a puid into 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 total puids
  • 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

21 Nov 17:44

Choose a tag to compare

Puid 2.2 introduces three new pre-defined character sets:

  • :base16 from RFC 4648
  • :crockford32 from Crockford
  • :wordSafe32, another strategy for avoiding English words in a manner similar to the exiting :safe32 characters

Puid 2.1

21 Nov 17:39

Choose a tag to compare

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.