dart_bs58

Creator: coderz1093

Last updated:

0 purchases

dart_bs58 Image
dart_bs58 Images

Languages

Categories

Add to Cart

Description:

dart bs58

dart_bs58 #
Dart component to compute base 58 encoding. This encoding is typically used for cryptocurrencies such as Bitcoin.
inspired by bs58.
Note: If you're looking for base 58 check encoding,
see: https://github.com/dart-bitcoin-lib/dart-bs58check, which
depends upon this library.
Install #
dart pub add dart_bs58
copied to clipboard
API #
encode(input) #
input must be a Uint8List or an Array. It
returns a string.
example:
import 'dart:typed_data';

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

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

final address = bs58.encode(bytes);
print(address);
// => 16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS
}
copied to clipboard
decode(input) #
input must be a base 58 encoded string. Returns
a Uint8List.
example:
import 'dart:typed_data';

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

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

print(hex.encode(bytes));
// => 003c176e659bea0f29a3e9bf7880c112b1b31b4dc826268187
}
copied to clipboard
LICENSE MIT #

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.