convertlib
3.6.1, released 4 months ago by bitanon.dev
Fast and error-resilient pure-Dart codecs for binary, octal, hex, base32, base64, UTF-8, and PHC strings.
What it does
Provides a pure-Dart library of fast, error-resilient codecs supporting Base-2, Base-8, Base-16, Base-32, Base-64, BigInt, UTF-8, and the PHC/Modular Crypt Format. It features zero dependencies, zero native code or FFI, and works across all platforms including the web and Flutter.
AI-written summary of version 3.6.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to encode or decode binary data to various text bases (Base16, Base32, Base64, etc.) without external dependencies.
- You are building or using cryptographic libraries that require constant-time byte comparisons and rendering digests as text.
- You need to parse or build PHC/Modular Crypt Format strings.
Skip it when
- You only need standard JSON serialization or basic UTF-8 string conversions already built into dart:convert.
Strengths
- Zero runtime dependencies and runs on every platform (VM, Flutter, Web).
- Comprehensive alphabet variants (RFC 4648, crockford, geohash, z-base-32, URL-safe, etc.).
- Includes non-throwing decoders and constant-time byte comparison.
Weaknesses
- Scope is strictly limited to encoding, decoding, and parsing specific text formats.
- Does not handle high-level cryptographic primitives on its own (relies on partner libraries like hashlib).
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:convertlib/convertlib.dart';
void main() {
final data = toUtf8('convertlib');
final hex = toHex(data);
final b64 = toBase64(data);
print('hex: $hex');
print('base64: $b64');
}Alternatives
Packages that do the same job and could replace convertlib.
- validators2
String validation and sanitization for Dart.
83Compare - standard_message_codec
Binary codec for efficient encoding/decoding of Dart objects without a schema.
80Compare - fast_gbk
Fast GBK codec for Dart, supports encoding/decoding and stream API.
45Compare - crypt
One-way string hashing for salted passwords using the Unix crypt format.
50Compare
Works with
Packages commonly used together with convertlib: ones it builds on, ones built on it, and its own family.