https://github.com/dart-bitcoin-lib/dart-bs58
Dart component to compute base 58 encoding. This encoding is typically used for cryptocurrencies such as Bitcoin.
https://github.com/dart-bitcoin-lib/dart-bs58
base58 dart dart-library dartlang flutter flutter-package
Last synced: 7 months ago
JSON representation
Dart component to compute base 58 encoding. This encoding is typically used for cryptocurrencies such as Bitcoin.
- Host: GitHub
- URL: https://github.com/dart-bitcoin-lib/dart-bs58
- Owner: dart-bitcoin-lib
- License: mit
- Created: 2021-11-16T14:19:27.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-22T12:31:03.000Z (almost 4 years ago)
- Last Synced: 2025-01-29T17:44:37.694Z (8 months ago)
- Topics: base58, dart, dart-library, dartlang, flutter, flutter-package
- Language: Dart
- Homepage: https://pub.dev/packages/dart_bs58
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
dart_bs58
====
Dart component to compute base 58 encoding. This encoding is typically used for cryptocurrencies such as Bitcoin.inspired by [bs58](https://github.com/cryptocoinjs/bs58).
**Note:** If you're looking for **base 58 check** encoding,
see: [https://github.com/dart-bitcoin-lib/dart-bs58check](https://github.com/dart-bitcoin-lib/dart-bs58check), which
depends upon this library.Install
-------dart pub add dart_bs58
API
---### encode(input)
`input` must be a [Uint8List](https://api.dart.dev/stable/2.13.4/dart-typed_data/Uint8List-class.html) or an `Array`. It
returns a `string`.**example**:
```dart
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
}
```### decode(input)
`input` must be a base 58 encoded string. Returns
a [Uint8List](https://api.dart.dev/stable/2.13.4/dart-typed_data/Uint8List-class.html).**example**:
```dart
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
}
```## LICENSE [MIT](LICENSE)