binary 4.0.0-alpha copy "binary: ^4.0.0-alpha" to clipboard
binary: ^4.0.0-alpha copied to clipboard

Utilities for accessing binary data and bit manipulation in Dart and Flutter

example/example.dart

import 'package:binary/binary.dart';

void main() {
  // Parse and reprsent a binary integer:
  final rawInt = int.parse('0111' '1111', radix: 2);
  final fixInt = Uint8(rawInt);
  print(fixInt); // 127

  // Works identically to the >>> operator in JavaScript:
  final shifted = fixInt.signedRightShift(5);
  print(shifted.toBinaryString()); // 00000011
}
23
likes
0
pub points
90%
popularity

Publisher

verified publisherlurey.dev

Utilities for accessing binary data and bit manipulation in Dart and Flutter

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

meta

More

Packages that depend on binary