msgpack_codec 2.0.1 copy "msgpack_codec: ^2.0.1" to clipboard
msgpack_codec: ^2.0.1 copied to clipboard

A message pack implementation for dart that works on all platforms.

example/example.dart

// ignore_for_file: avoid_print

import 'dart:typed_data';

import 'package:msgpack_codec/msgpack_codec.dart';

void main(List<String> args) {
  final data = {
    'name': 'John Doe',
    'age': 30,
    'isEmployed': true,
    'children': [
      {'name': 'Alice', 'age': 7},
      {'name': 'Bob', 'age': 10},
    ],
  };

  final encoded = msgPack.encode(data);

  print('Encoded: ${_toHexString(encoded)}');

  final decoded = msgPack.decode(encoded);

  print('Decoded: $decoded');
}

String _toHexString(Uint8List bytes) =>
    bytes.map((i) => i.toRadixString(16).padLeft(2, '0')).join('-');
0
likes
160
points
111
downloads

Publisher

verified publisherskycoder42.de

Weekly Downloads

A message pack implementation for dart that works on all platforms.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

meta

More

Packages that depend on msgpack_codec