Git Product home page Git Product logo

msgpack2's Introduction

MsgPack for Dart

Build Status

A full-featured MsgPack library for Dart 1.x and 2.x.

Attribution

This package was originally forked from msgpack. Due to the number of incompatible refactorings and loss of backwards compatibility, the decision was made to spin it off as a new package. This package contains numerous enhancements over the original MsgPack implementation which should help with performance in many places (see benchmarks), as well as a more complete testing suite.

Usage

Because this project relies on Dart Libraries which contain inconsistencies between Dart 1.x and Dart 2.x, there are two versions of the this package maintained.

If you want to use this package for Dart projects with Dart 2.x, please ensure your version dependencies are set to:

  dependencies:
    msgpack2: ^2.0.0

If you want to use this package for Dart projects with Dart 1.x, please ensure your version dependencies are set to:

  dependencies:
    msgpack2: ^1.0.0

Simple Example

import "dart:typed_data";

import "package:msgpack/msgpack.dart";

main() {
  var binary = new Uint8List.fromList(
    new List<int>.generate(40, (int i) => i)
  ).buffer.asByteData();

  var data = {
    "String": "Hello World",
    "Integer": 42,
    "Double": 45.29,
    "Integer List": [1, 2, 3],
    "Binary": binary,
    "Map": {
      1: 2,
      3: 4
    }
  };

  List<int> packed = pack(data);
  Map unpacked = unpack(packed);

  print(unpacked);
}

msgpack.org[dart-msgpack2]

msgpack2's People

Contributors

butlermatt avatar jodinathan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.