dart_varuint_bitcoin 1.0.3 copy "dart_varuint_bitcoin: ^1.0.3" to clipboard
dart_varuint_bitcoin: ^1.0.3 copied to clipboard

This package uses it to encode/decode the number as bitcoin variable length integer.

example/dart_varuint_bitcoin_example.dart

import 'dart:typed_data';

import 'package:convert/convert.dart';
import 'package:dart_varuint_bitcoin/dart_varuint_bitcoin.dart' as varuint;

void main() {
  Uint8List buffer = Uint8List(2);
  final encoded = varuint.encode(0xfc, buffer, 1);
  print(hex.encode(encoded.buffer.buffer.asUint8List()));
  // => 00fx

  Uint8List buffer2 = Uint8List.fromList([0x00, 0xfc]);
  final decoded = varuint.decode(buffer2, 1);
  print(decoded.output.toRadixString(16));
  // => fc
}
0
likes
160
pub points
35%
popularity

Publisher

verified publishermahsumurebe.com

This package uses it to encode/decode the number as bitcoin variable length integer.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on dart_varuint_bitcoin