convertlib 3.5.1
convertlib: ^3.5.1 copied to clipboard
Fast and error resilient codecs. Currently supporting Binary(Base2), Hexadecimal(Base16), Base32, Base64, BigInt.
3.5.1 #
- Widen
fromUtf8to accept anyList<int>input instead of requiring aUint8List. Non-Uint8Listinputs are copied to aUint8Listbefore decoding.
3.5.0 #
- [Breaking Changes]
- Renames internal abstract class
HashlibConvertertoCipherlibConverter. - Removes
encodeString,decodeStringfromIterableCodec.
- Renames internal abstract class
- Fix
CryptDataBuilder.paramto throw anArgumentErrorwhen the value isnull, instead of a rawTypeError. - 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
toUtf8usingUint8Listbuffer instead of plainList<int>. UTF-8 encoding now outperformsdart:convert. - Speed up
fromUtf8with a dedicated byte-to-string decoder. UTF-8 decoding now matches closely withdart:convert. - Refactor existing benchmarks and add missing ones. Dropping
benchmark_harnessdependency in favor of custom benchmarking class with better flexibility.
3.4.0 #
- Rename the package from
hashlib_codecstoconvertlib. The public API is unchanged: update the dependency toconvertliband imports topackage:convertlib/convertlib.dart. - The
hashlib_codecspackage continues to be published as a thin re-export ofconvertlibfor backward compatibility, and will be discontinued after a migration period.
3.3.1 #
- Fix
CryptData.validaterejecting valid Modular Crypt Format hashes such asbcrypt, whose base64 alphabet uses.. Thehashfield now accepts the same characters as thesalt([a-zA-Z0-9/+.-]), reverting the overly strict B64 restriction introduced in3.3.0. - Document every public API element (100% dartdoc coverage) and correct several
inaccurate doc comments, including the
Base8Codecalphabet (01234567) and the octal/binary notes ontoOctal.
3.3.0 #
- [Breaking Changes]
ByteCollector.isEqualrequires anIterableargument to match the full length; previously a strict prefix of the bytes compared equal.CryptData.validatenow 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 areBase32andBase64.
ByteCollector.isEqualnow 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
3.2.0 #
- [Breaking Changes]
- Fix
Base32Codec.wordSafeto use the documented word-safe alphabet (23456789CFGHJMPQRVWXcfghjmpqrvwx); it previously used the z-base-32 alphabet. ByteCollectorequality is now value-based:==andhashCodecompare the collected bytes instead of the identity of the underlying list.
- Fix
- Fix UTF-8 decoder producing wrong code points for some 2-byte sequences (e.g.
U+0100) - Fix
ByteCollector.isEqualcomparing against its own buffer when given aByteBuffer - Fix
ByteCollector.isEqualignoring the offset and length of a partialTypedDataview - Fix incorrect alphabets of
crockfordandgeohashin the README - Fix incorrect parameter descriptions of
toBase32,fromBase32,fromBase64, andfromUtf8 - Document that
toUtf8rejects unpaired surrogates
3.1.2 #
- Add const constructor to
ByteCollectorclass.
3.1.0 #
- Introduce
ByteCollectorabstract class with methods for various encoding formats (hex, binary, octal, base32, base64, BigInt). and utility methods for equality check.
3.0.1 #
- Test release with workflow
3.0.0 #
- Set minimum Dart SDK to 2.19.0
2.6.0 #
- [Breaking Changes]
- Change the behavior of the Base-8 encoder to follow the standard
- Accept only
List<int>instead ofIterable<int>in converters
2.5.0 #
- Support UTF-8 encoding and decoding.
- New class:
UTF8Codec - New methods:
toUtf8,fromUtf8
- New class:
- Renames:
HashlibCodec->IterableCodec
- Minor performance impovements
2.4.1 #
- Refactor: Remove all sync generator to improve runtime.
2.4.0 #
- Breaking Changes: Uses string for salt and hash in
CryptData - New class
CryptDataBuilderis available to constructCryptDatainstances.
2.3.0 #
- Breaking Changes: Renames PHCSF -> CryptFormat. Affected names:
- Class:
PHCSF->CryptFormatPHCSFData->CryptDataPHCSFEncoder->CryptEncoderPHCSFDecoder->CryptDecoder
- Constant:
phcsf->crypt
- Methods:
toPHCSF->toCryptfromPHCSF->fromCrypt
- Class:
2.2.0 #
- Support encoding and decoding with PHC string format specification
- New Class :
PHCSF - New Constant:
phcsf - New Methods :
toPHCSF,fromPHCSF
- New Class :
2.1.0 #
- Adds more alphabets to
Base32Codec. Additional alphabets are:- base32hex
- Lowerase base32hex
- Crockford's Base32
- Geohash's Base32
- z-base-32
- Word-safe alphabet
- Allows the
paddingparameter to be effective to any codecs inBase32CodecandBase64Codec.
2.0.0 #
- Breaking: Removes all constant exports.
- They are now available inside codec class. e.g.:
Base64Codec.urlSafe
- They are now available inside codec class. e.g.:
- 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
- New class:
- Renames a lot of exports
Uint8Converter->BitConverterUint8Codec->HashlibCodecBinaryCodec->Base2CodecB16Codec->Base16CodecB64Codec->Base64Codec
- Separates base encoder and decoders
- Generic encoders:
BitEncoder,AlphabetEncoder - Generic decoders:
BitDecoder,AlphabetDecoder
- Generic encoders:
1.2.0 #
- Adds
BigIntcodec support.- New class:
BigIntCodec - New methods:
fromBigInt,toBigInt - New constant:
bigintLE,bigintBE
- New class:
- Updates documentations.
1.1.1 #
- Updates project description.
1.1.0 #
- Fixes padding issues with
base2andbase16 - In
toBase32, uses the parameterlowerreplacingupper. - Transfers
fromBase64UrltofromBase64with extended alphabet. - Transfers
toBase64UrltotoBase64with optionalurlparameter. - Improves documentation
1.0.0 #
- First release