fast_base58 0.1.8

  • Readme
  • Changelog
  • Example
  • Installing
  • 69

Fast Implementation of Base58 encoding #

Base algorithm is copied from https://github.com/trezor/trezor-crypto/blob/master/base58.c

Usage #

A simple usage example:

import 'dart:convert'; // for utf8
import 'package:fast_base58/fast_base58.dart';

main() {
  var encodedStr = Base58Encode(utf8.encode('bitcoin'.codeUnits)); // Uint8List(raw bytes) to base58 string
  print(encodedStr); // 4jJc4sAwPs

  var decodedRaw = Base58Decode('4jJc4sAwPs'); // base58 string to Uint8List(raw bytes)
  print(utf8.decode(decodedRaw)); // bitcoin
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.1.8 #

  • Add more test vec, and use uft8 in example.

0.1.7 #

  • Fix wrong package name in README

0.1.6 #

  • Update readme, removing template words from stagehand.

0.1.5 #

  • WTF? TOO LONG??? ok, shorten it.

0.1.5 #

  • WTF? TOO LONG??? ok, shorten it.

0.1.4 #

  • WTF? TOO LONG??? ok, shorten it.

0.1.3 #

  • Update pubspec.yaml

0.1.2 #

  • Enrich doc

0.1.1 #

  • Format project

0.1.0 #

  • Initial version, created by Stagehand
  • Migrate the main functions from github.com/mr-tron/base58

example/example.dart

import 'dart:convert';

import 'package:fast_base58/fast_base58.dart';

void main() {
  // Uint8List(raw bytes) to base58 string
  var encodedStr = Base58Encode(utf8.encode('bitcoin'));
  // 4jJc4sAwPs
  print(encodedStr);

  // base58 string to Uint8List(raw bytes)
  var decodedRaw = Base58Decode('4jJc4sAwPs');
  // bitcoin
  print(utf8.decode(decodedRaw));
}

Use this package as a library

1. Depend on it

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


dependencies:
  fast_base58: ^0.1.8

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:fast_base58/fast_base58.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
39
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
69
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
Dev dependencies
pedantic ^1.8.0
test ^1.6.0