base32 0.1.2

  • Installing
  • Versions
  • 41

Build Status


Simple base32 encode/decode matching the base32 method used by Google Authenticator.


Getting Started

Pubspec (you can use 'any' instead of a version if you just want the latest always)

  base32: 0.0.7
import 'package:base32/base32.dart';

Start encoding/decoding ...

// Encode a hex string to base32
base32.encodeHexString('48656c6c6f21deadbeef'); // -> 'JBSWY3DPEHPK3PXP'

// base32 decoding to original string.
base32.decode("JBSWY3DPEHPK3PXP"); // -> '48656c6c6f21deadbeef'


base32.encode(List byteList)

Generate and return a RFC4122 v1 (timestamp-based) UUID.

  • byteList - (List) A list of bytes representing your input.

Returns String representation of the encoded base32.

base32.encodeHexString(String hex)

Generate and return a RFC4122 v4 UUID.

  • hexString - (String) A string of hex values intended to be converted to bytes and encoded.

Returns String representation of the encoded base32

Example: Encode a hex string.

base32.encodeHexString('48656c6c6f21deadbeef'); // -> 'JBSWY3DPEHPK3PXP'

base32.decode(String base32)

Decodes a base32 string back to its original byte values.

  • base32 - (String) The base32 string you wish to decode.

Returns Uint8List of the decoded data.

Example: Decode a base32 string, then output it in hex format

var decoded = base32.decode("JBSWY3DPEHPK3PXP");
var decodedHex = CryptoUtils.bytesToHex(decoded); // -> '48656c6c6f21deadbeef'


In dartvm

dart test\base32_test.dart

In Browser

At the moment, this package does not work client-side as it uses server-side only UInt8Lists. I might have to wait till UInt8Arrays and UInt8Lists are merged into 1

Release notes


  • Merge Pull Request to move most dependencies to dev_dependecies

v0.1.0 & v0.1.1wq

  • Updates for Dart 1.0 readiness.


  • Fix crypto import in the test.


  • Fix for typed_data name change. Thanks to the pull requestor for bringing it to my attention and fixing it.


  • Fix for language changes.


  • Fix for language changes.


  • Fixes and changes for M3
  • New hex to byte converter.


  • Made all functions static.


  • Fixed unittest dependency


  • Initial Documented Release

1. Depend on it

Add this to your package's pubspec.yaml file:

  base32: "^0.1.2"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:base32/base32.dart';
Version Uploaded Documentation Archive
0.1.2 Jan 31, 2015 Go to the documentation of base32 0.1.2 Download base32 0.1.2 archive
0.1.1 Nov 9, 2013 Go to the documentation of base32 0.1.1 Download base32 0.1.1 archive
0.1.0 Nov 9, 2013 Go to the documentation of base32 0.1.0 Download base32 0.1.0 archive
0.0.8 Sep 14, 2013 Go to the documentation of base32 0.0.8 Download base32 0.0.8 archive
0.0.7 May 27, 2013 Go to the documentation of base32 0.0.7 Download base32 0.0.7 archive
0.0.6 Apr 11, 2013 Go to the documentation of base32 0.0.6 Download base32 0.0.6 archive
0.0.5 Mar 3, 2013 Go to the documentation of base32 0.0.5 Download base32 0.0.5 archive
0.0.4 Jan 22, 2013 Go to the documentation of base32 0.0.4 Download base32 0.0.4 archive
0.0.3 Jan 3, 2013 Go to the documentation of base32 0.0.3 Download base32 0.0.3 archive
0.0.2 Dec 14, 2012 Go to the documentation of base32 0.0.2 Download base32 0.0.2 archive

All 11 versions...


This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • tool failures on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1


Describes how popular the package is relative to other packages. [more]
35 / 100
Code health derived from static analysis. [more]
78 / 100
Reflects how tidy and up-to-date the package is. [more]
0 / 100
Overall score:
Weighted score of the above. [more]


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:base32/base32.dart.


  • Fix lib/base32.dart.

    Strong-mode analysis of lib/base32.dart failed with the following error:

    line: 12 col: 37
    The argument type 'List' can't be assigned to the parameter type 'Iterable<int>'.

  • Maintain

    Changelog entries help clients to follow the progress in your code.

  • Fix issues reported by dartanalyzer.

    dartanalyzer reported 1 error(s) and 0 warning(s).

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use base32.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=0.8.10+6 <2.0.0
Dev dependencies
crypto >=0.9.0 <0.10.0
unittest >=0.9.0 <0.10.0