bs58check 1.0.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 62

bs58check

A straight forward implementation of base58check extending upon bs58 for Flutter writing in Dart.

Inspired by bitcoinjs

Example

import 'package:bs58check/bs58check.dart' as bs58check;

Uint8List decoded = bs58check.decode('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr');

print(decoded);
// => [128, 237, 219, 220, 17, 104, 241, 218, 234, 219, 211, 228, 76, 30, 63, 143, 90, 40, 76, 32, 41, 247, 138, 210, 106, 249, 133, 131, 164, 153, 222, 91, 25]

print(HEX.encode(decoded));
// => 80eddbdc1168f1daeadbd3e44c1e3f8f5a284c2029f78ad26af98583a499de5b19

print(bs58check.encode(decoded));
// => 5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr


// for fun
print(bs58check.getAddress('AnDoan'));
// => 1AnDoannV16NE8AQ74obrTNf6i2jbahYadr

1.0.1

  • Initial version, created by anicdh

example/bs58check_example.dart

import '../lib/bs58check.dart' as bs58check;
import 'dart:typed_data';
import 'package:hex/hex.dart';
main() {
  Uint8List decoded = bs58check.decode('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr');
  print(decoded);
  print(HEX.encode(decoded));
  print(bs58check.encode(decoded));
  print(bs58check.getAddress('AnDoan'));
}

Use this package as a library

1. Depend on it

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


dependencies:
  bs58check: ^1.0.1

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 flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:bs58check/bs58check.dart';
  
Version Uploaded Documentation Archive
1.0.1 Oct 11, 2018 Go to the documentation of bs58check 1.0.1 Download bs58check 1.0.1 archive
1.0.0 Oct 11, 2018 Go to the documentation of bs58check 1.0.0 Download bs58check 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
24
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]
62
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

Format lib/src/bs58check_base.dart.

Run dartfmt to format lib/src/bs58check_base.dart.

Format lib/src/utils/base.dart.

Run dartfmt to format lib/src/utils/base.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.58.0 <3.0.0
crypto ^2.0.3 2.0.6
hex ^0.1.2 0.1.2
Transitive dependencies
charcode 1.1.2
collection 1.14.11
convert 2.0.2
typed_data 1.1.6
Dev dependencies
test ^1.0.0