encode_endian 1.0.0 copy "encode_endian: ^1.0.0" to clipboard
encode_endian: ^1.0.0 copied to clipboard

A library can convert integer to big endian or little endian.

A library can convert integer to big endian or little endian.

A Dart version of endian-code

Usage #

A simple usage example:

import 'package:encode_endian/encode_endian.dart';
import 'package:encode_endian/base.dart';

main() {
  // default convert to big endian
  // [0x01, 0x02]
  encodeEndian(0x0102, 2);
  // [255, 221]
  encodeEndian(-35, 2);
  // [0x00, 0x00, 0x12, 0x34]
  encodeEndian(0x1234, 4);

  // convert to little endian
  // [0x34, 0x12]
  encodeEndian(0x1234, 2, endianType: EndianType.littleEndian);
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

3
likes
15
pub points
0%
popularity

Publisher

unverified uploader

A library can convert integer to big endian or little endian.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

collection

More

Packages that depend on encode_endian