Skip to content

Upgrade guide

To v2

Generally speaking, v2 broke the public API a bit, so most projects using v1 could probably work as-is with v2. However, the private API changed a lot.

Old signatures will fail

Data signed with previous versions fails with InvalidSignatureError.

Public API changes

  • Blake2Signer|Blake2TimestampSigner|Blake2SerializerSigner.SEPARATOR class attribute is replaced by the separator instance attribute and is now checked to be ASCII only and not belong to the encoder alphabet.
  • Blake2SerializerSigner.COMPRESSION_FLAG class attribute is replaced by the compression_flag instance attribute and is now checked to be ASCII only.
  • Blake2SerializerSigner.COMPRESSION_RATIO class attribute is replaced by the compression_ratio instance attribute and is now checked to be ASCII only.
  • The default digest size for all signers is set to 16 bytes. Previously, Blake2Signer and Blake2TimestampSigner defaulted to the maximum allowed size for the hasher.
  • The compression parameter used in Blake2SerializerSigner named use_compression is renamed to compress.

Private API changes

The private API changed a lot, so if you were using some private methods please review them for changes! Unfortunately I can't list them all here but mainly check these commits:

  • c6acaa0a - 🏗 Split classes into own modules by type
  • 0b1d0a6c - ✨ Allow changing encoder in every signer
  • c9bcd173 - ✨ Make separator an instance attribute
  • 675389de - ✨ Make comp flag and ratio an instance attribute
  • 8618e663 - ♻ Refactor serializer signer base methods
  • 40ccbd40 - ✨ Add new methods to get data and sig separately
  • b2d69910 - ♻ Rename use_compression to compress