Skip to content
- Update
README.md for the 3.6.0 API: the to<Name>Bytes byte encoders, the
non-throwing tryFrom<Name> decoders, constantTimeEquals, the exported
converter base classes, and the case-insensitive Crockford decoding.
- [Breaking Changes]
CipherlibConverter -> BitConverter (the exported bit-converter base class).
BigIntDecoder narrows from Converter<BigInt, Iterable<int>> to
Converter<BigInt, Uint8List>; BigIntCodec decoders now return a Uint8List.
- Export the
ByteEncoder, ByteDecoder, AlphabetEncoder, and AlphabetDecoder
base classes, previously part of the API surface but not reachable through
package:convertlib/convertlib.dart.
- Add
constantTimeEquals, a top-level constant-time byte comparison for
verifying MACs and digests without wrapping them in a ByteCollector.
- Add
toHexBytes, toBinaryBytes, toOctalBytes, toBase32Bytes, and
toBase64Bytes, returning the encoded ASCII output as a Uint8List without
the intermediate String.
- Add non-throwing decoders
tryFromHex, tryFromBinary, tryFromOctal,
tryFromBase32, tryFromBase64, tryFromUtf8, and tryFromBigInt, which
return null instead of throwing a FormatException on invalid input.
- Fix the UTF-8 encoder emitting invalid bytes for scalar code points in
U+10000..U+10FFFF; UTF8Encoder.convert now uses the 4-byte form (the public
toUtf8 was unaffected). Verified against dart:convert.
- Make the Crockford Base-32 decoder case-insensitive and decode the ambiguous
letters
I/i/L/l as 1 and O/o as 0. Encoding output is unchanged.
- Fix
ByteCollector.number truncating values wider than 32 bits on the web; it
now accumulates with multiplication and is exact up to 2^53 (VM unchanged).
ByteCollector.isEqual returns false for a [String] that is not valid
hexadecimal instead of throwing a FormatException, matching its contract.
- Add value-based
== and hashCode to CryptData; a null and an empty
params map now compare equal (both encode to the same string).
- PHC/crypt: allow empty parameter values (e.g.
$id$data=), and fix the decoder
mis-classifying a comma-containing v=... segment as the version.
- Speed up
fromBase32/fromBase64 decoding and the generic AlphabetEncoder by
removing extra allocations and passes; output is byte-identical.
- Clarify the
FormatException message for non-canonical encoded input:
'Invalid length' is now 'Invalid length or non-zero trailing bits'.
- Widen
fromUtf8 to accept any List<int> input instead of requiring a
Uint8List. Non-Uint8List inputs are copied to a Uint8List before
decoding.
- [Breaking Changes]
- Removes
encodeString, decodeString from IterableCodec.
- Renames internal abstract class
HashlibConverter to CipherlibConverter.
- Fix
CryptDataBuilder.param to throw an ArgumentError when the value is
null, instead of a raw TypeError.
- Speed up Base-64 and Base-32 encoding with specialized single-pass encoders.
Base-64 encoding now outperforms
dart:convert.
- Speed up Base-64 and Base-32 decoding with specialized single-pass decoders.
Base-64 decoding now outperforms
dart:convert.
- Speed up
toUtf8 using Uint8List buffer instead of plain List<int>.
UTF-8 encoding now outperforms dart:convert.
- Speed up
fromUtf8 with a dedicated byte-to-string decoder.
UTF-8 decoding now matches closely with dart:convert.
- Refactor existing benchmarks and add missing ones. Dropping
benchmark_harness
dependency in favor of custom benchmarking class with better flexibility.
- Rename the package from
hashlib_codecs to convertlib. The public API is
unchanged: update the dependency to convertlib and imports to
package:convertlib/convertlib.dart.
- The
hashlib_codecs package continues to be published as a thin re-export of
convertlib for backward compatibility, and will be discontinued after a
migration period.
- Fix
CryptData.validate rejecting valid Modular Crypt Format hashes such as
bcrypt, whose base64 alphabet uses .. The hash field now accepts the
same characters as the salt ([a-zA-Z0-9/+.-]), reverting the overly
strict B64 restriction introduced in 3.3.0.
- Document every public API element (100% dartdoc coverage) and correct several
inaccurate doc comments, including the
Base8Codec alphabet (01234567) and
the octal/binary notes on toOctal.
- [Breaking Changes]
ByteCollector.isEqual requires an Iterable argument to match the full
length; previously a strict prefix of the bytes compared equal.
CryptData.validate now follows the PHC string format specification
strictly: the hash must be a B64 string ([a-zA-Z0-9/+], no . or -),
and the version must not have leading zeros.
- Reject invalid values after padding in
AlphabetDecoder. Affected codecs are Base32 and Base64.
ByteCollector.isEqual now compares content in constant time, making it safe
for comparing MACs and message digests
- Performance improvements (measured on Apple Silicon, 10KB inputs):
- Base-32 decoding: ~6x faster (425 Mbps -> 2.52 Gbps)
- Base-64 decoding: ~6.4x faster (453 Mbps -> 2.9 Gbps)
- UTF-8 encoding: ~6.5x faster (403 Mbps -> 2.61 Gbps)
- Update the PHC string format specification link to its new home at C2SP
- [Breaking Changes]
- Fix
Base32Codec.wordSafe to use the documented word-safe alphabet
(23456789CFGHJMPQRVWXcfghjmpqrvwx); it previously used the z-base-32 alphabet.
ByteCollector equality is now value-based: == and hashCode compare the
collected bytes instead of the identity of the underlying list.
- Fix UTF-8 decoder producing wrong code points for some 2-byte sequences (e.g.
U+0100)
- Fix
ByteCollector.isEqual comparing against its own buffer when given a ByteBuffer
- Fix
ByteCollector.isEqual ignoring the offset and length of a partial TypedData view
- Fix incorrect alphabets of
crockford and geohash in the README
- Fix incorrect parameter descriptions of
toBase32, fromBase32, fromBase64, and fromUtf8
- Document that
toUtf8 rejects unpaired surrogates
- Add const constructor to
ByteCollector class.
- Introduce
ByteCollector abstract class with methods for various encoding formats (hex, binary, octal, base32, base64, BigInt).
and utility methods for equality check.
- Test release with workflow
- Set minimum Dart SDK to 2.19.0
- [Breaking Changes]
- Change the behavior of the Base-8 encoder to follow the standard
- Accept only
List<int> instead of Iterable<int> in converters
- Support UTF-8 encoding and decoding.
- New class:
UTF8Codec
- New methods:
toUtf8, fromUtf8
- Renames:
HashlibCodec -> IterableCodec
- Minor performance impovements
- Refactor: Remove all sync generator to improve runtime.
- Breaking Changes: Uses string for salt and hash in
CryptData
- New class
CryptDataBuilder is available to construct CryptData instances.
- Breaking Changes: Renames PHCSF -> CryptFormat. Affected names:
- Class:
PHCSF -> CryptFormat
PHCSFData -> CryptData
PHCSFEncoder -> CryptEncoder
PHCSFDecoder -> CryptDecoder
- Constant:
- Methods:
toPHCSF -> toCrypt
fromPHCSF -> fromCrypt
- Adds new alphabet to
Base64Codec: bcrypt
- Adds more alphabets to
Base32Codec. Additional alphabets are:
- Allows the
padding parameter to be effective to any codecs in Base32Codec and Base64Codec.
- Breaking: Removes all constant exports.
- They are now available inside codec class. e.g.:
Base64Codec.urlSafe
- Breaking: Modify parameters of all public methods.
- Improves encoding and decoding algorithm.
- Adds Base-8 (Octal) codec support
- New class:
Base8Codec
- New methods:
fromOctal, toOctal
- Renames a lot of exports
Uint8Converter -> BitConverter
Uint8Codec -> HashlibCodec
BinaryCodec -> Base2Codec
B16Codec -> Base16Codec
B64Codec -> Base64Codec
- Separates base encoder and decoders
- Generic encoders:
BitEncoder, AlphabetEncoder
- Generic decoders:
BitDecoder, AlphabetDecoder
- Adds
BigInt codec support.
- New class:
BigIntCodec
- New methods:
fromBigInt, toBigInt
- New constant:
bigintLE, bigintBE
- Updates documentations.
- Updates project description.
- Fixes padding issues with
base2 and base16
- In
toBase32, uses the parameter lower replacing upper.
- Transfers
fromBase64Url to fromBase64 with extended alphabet.
- Transfers
toBase64Url to toBase64 with optional url parameter.
- Improves documentation