Skip to content

v0.5.0

Latest
Compare
Choose a tag to compare
@michaelherold michaelherold released this 18 Aug 11:44
· 21 commits to main since this release

0.5.0 - 2022-08-18

Added

  • If you'd rather deal in KSUID strings instead of KSUID::Types, you can now generate them simply with KSUID.string. It takes the same arguments, payload and time as KSUID.new, but returns a string instead of a KSUID::Type.
  • KSUID.prefixed and the KSUID::Prefixed class now can generate prefixed KSUIDs to make them visually identifiable for their source. You cannot prefix a binary-encoded KSUID, only base 62-encoded ones.
  • ActiveRecord::KSUID now accepts a prefix: argument for handling prefixed KSUIDs. In addition, the ksuid column type also accepts a prefix: argument to calculate the intended size of the column with the prefix.

Deprecated

  • KSUID::ActiveRecord is now ActiveRecord::KSUID. The original constant will continue to work until v1.0.0, but will emit a warning upon boot of your application. To silence the deprecation, change all uses of KSUID::ActiveRecord to the new constant, ActiveRecord::KSUID. See the upgrading notice for more information.

Miscellaneous

  • The compatibility check for the Base62 implementation in the gem is about 10x faster now. The original optimization did not optimize as much due to an error with the benchmark. This change has a tested benchmark that shows a great improvement. Note that this is a micro-optimization and we see no real performance gain in the parsing of KSUID strings.