Skip to content
pubscout

base32

2.2.0, released a year ago by yuli.dev

Base32 encoder and decoder for Dart, supporting multiple variants and OTP secrets.

WASM-ready
$ flutter pub add base32
Source repository

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.

  • archive

    Encodes and decodes archive and compression formats such as zip, tar, gzip, and zlib.

  • canonical_json

    Encoder and decoder for canonical JSON format useful for cryptographic hashing and signing.

  • serial_csv

    High-performance CSV encoder/decoder preserving types and nullability

Works with

Packages commonly used together with base32: ones it builds on, ones built on it, and its own family.