dart_base_x 1.0.0 copy "dart_base_x: ^1.0.0" to clipboard
dart_base_x: ^1.0.0 copied to clipboard

Fast base encoding / decoding of any given alphabet using bitcoin style leading zero compression.

example/dart_base_x_example.dart

import 'dart:typed_data';

import 'package:dart_base_x/dart_base_x.dart';

void main() {
  String base58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';

  BaseXCodec bs58 = BaseXCodec(base58);

  Uint8List decoded =
      bs58.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, 19, 164, 248, 99]

  print(bs58.encode(decoded));
  // => 5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr
}
0
likes
160
points
657
downloads

Publisher

verified publishermahsumurebe.com

Weekly Downloads

Fast base encoding / decoding of any given alphabet using bitcoin style leading zero compression.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on dart_base_x