base32
2.2.0, released a year ago by yuli.dev
Base32 encoder and decoder for Dart, supporting multiple variants and OTP secrets.
What it does
Provides simple base32 encoding and decoding conforming to RFC4648. It handles byte lists, hex strings, and plain strings, as well as multiple variants such as base32Hex, crockford, z-base-32, and geohash.
AI-written summary of version 2.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to encode or decode Base32 strings for One Time Password (OTP) secrets.
- You are working with RFC4648 Base32 or its variants like Crockford or Geohash.
Skip it when
- You need standard Base64 encoding instead of Base32.
Strengths
- Supports multiple variants including base32Hex, crockford, z-base-32, and geohash.
- Provides helper methods for encoding and decoding hex and plain strings directly.
Weaknesses
- Limited to Base32 operations.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:base32/base32.dart';
// Encode a hex string to base32
final encoded = base32.encodeHexString('48656c6c6f21deadbeef'); // -> 'JBSWY3DPEHPK3PXP'
// Decode base32 string
final decoded = base32.decodeAsHexString('JBSWY3DPEHPK3PXP'); // -> '48656c6c6f21deadbeef'Alternatives
Packages that do the same job and could replace base32.
- totp
Generate and verify Time-based One-time Passwords (TOTP) following RFC 6238.
64Compare - archive
Encodes and decodes archive and compression formats such as zip, tar, gzip, and zlib.
92Compare - canonical_json
Encoder and decoder for canonical JSON format useful for cryptographic hashing and signing.
72Compare - serial_csv
High-performance CSV encoder/decoder preserving types and nullability
70Compare
Works with
Packages commonly used together with base32: ones it builds on, ones built on it, and its own family.
- otpBuilt on base32Generate TOTP/HOTP codes per RFC6238/4226 with Base32 secrets and optional Google Auth mode.
- finchBuilt on base32A lightweight Dart framework for building server‑side web apps, APIs, databases and WebSockets.
- dart_natsBuilt on base32A Dart and Flutter client library for the NATS messaging system.
- dart_libp2pBuilt on base32A Dart implementation of the libp2p networking stack for peer-to-peer applications.
- dart_dash_otpBuilt on base32Generate and verify TOTP and HOTP one-time passwords for 2FA and MFA.
- algorand_dartBuilt on base32Community SDK for interacting with the Algorand blockchain in Dart and Flutter.