dart_bs58 1.0.1 copy "dart_bs58: ^1.0.1" to clipboard
dart_bs58: ^1.0.1 copied to clipboard

Dart component to compute base 58 encoding. This encoding is typically used for cryptocurrencies such as Bitcoin.

example/dart_bs58_example.dart

import 'dart:typed_data';

import 'package:convert/convert.dart';
import 'package:dart_bs58/dart_bs58.dart';

void encodeTest() {
  final Uint8List bytes =
      hex.decode('003c176e659bea0f29a3e9bf7880c112b1b31b4dc826268187')
          as Uint8List;

  final address = bs58.encode(bytes);
  print(address);
  // => 16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS
}

void decodeTest() {
  final address = '16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS';
  final Uint8List bytes = bs58.decode(address);

  print(hex.encode(bytes));
  // => 003c176e659bea0f29a3e9bf7880c112b1b31b4dc826268187
}

void main() {
  encodeTest();
  decodeTest();
}
0
likes
160
points
450
downloads

Publisher

verified publishermahsumurebe.com

Weekly Downloads

Dart component to compute base 58 encoding. This encoding is typically used for cryptocurrencies such as Bitcoin.

Repository
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

dart_base_x

More

Packages that depend on dart_bs58