msgpack_codec 2.0.0 copy "msgpack_codec: ^2.0.0" to clipboard
msgpack_codec: ^2.0.0 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
0
points
110
downloads

Publisher

verified publisherskycoder42.de

Weekly Downloads

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

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

meta

More

Packages that depend on msgpack_codec