ffi_assist 0.1.0 copy "ffi_assist: ^0.1.0" to clipboard
ffi_assist: ^0.1.0 copied to clipboard

A helper library for implementations using dart:ffi

ffi_assist #

Overview #

ffi_assist is a helper library for interfacing with native libraries using Dart's FFI.

Installation #

Add the following to your pubspec.yaml:

dependencies:
  ffi_assist: ^1.0.0

Usage #

import 'package:ffi_assist/ffi_assist.dart';

void main() {
  // Example: Convert hex string to bytes.
  final hexStr = "0123456789abcdef";
  final bytes = hex2bytes(hexStr);
  print("hex2bytes: $bytes");

  // Example: Display bytes as blocked hex string (4 bytes per block).
  final blocked = bytes.toBlockedHexString(4);
  print("toBlockedHexString:\n$blocked");

  // Example: Little endian conversion of an integer.
  final leBytes = littleEndianBytes(0x0123456789abcdef, len: 8);
  print("littleEndianBytes: $leBytes");

  // Example: Big endian conversion of an integer.
  final beBytes = bigEndianBytes(0x0123456789abcdef, len: 8);
  print("bigEndianBytes: $beBytes");
}

Contributing #

Contributions are welcome! Please submit a pull request or open an issue.

1
likes
130
points
30
downloads

Publisher

verified publisherscenee.dev

Weekly Downloads

A helper library for implementations using dart:ffi

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

ffi

More

Packages that depend on ffi_assist