Skip to content

Puid 2.3

Choose a tag to compare

@dingosky dingosky released this 21 Nov 17:57
· 26 commits to master since this release

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.