leb128 0.9.1 copy "leb128: ^0.9.1" to clipboard
leb128: ^0.9.1 copied to clipboard

outdated

A Dart package that can read and write numbers in the LEB128, short for Little Endian Base 128, format.

example/lib/main.dart

import 'package:leb128/leb128.dart';

void main() {
  var input = -9019283812387;

  // Encode the negative number shown above
  var output = Leb128.encodeSigned(input);

  // Print the individual bytes of the encoded
  // number in hex
  output.forEach((x) {
    print(x.toRadixString(16));
  });

  // Decode the LEB128 number into an ordinary integer and
  // print it
  print(Leb128.decodeSigned(output));

  // Quickly decode a varuint7
  print(Leb128.decodeVaruint7(0x08).toRadixString(16));
}
2
likes
30
pub points
41%
popularity

Publisher

unverified uploader

A Dart package that can read and write numbers in the LEB128, short for Little Endian Base 128, format.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on leb128