Did you know ... | Search Documentation: |
Packs (add-ons) for SWI-Prolog |
Title: | DCG for packing & unpacking of MessagePack data to/from bytes |
---|---|
Rating: | Not rated. Create the first rating! |
Latest version: | 0.1.6 |
SHA1 sum: | 6e5b3c2f5aa179564fe4b7acd12213c88806d833 |
Author: | James N. V. Cash <james.cash@occasionallycogent.com> |
Home page: | https://github.com/jamesnvc/msgpack |
Download URL: | https://github.com/jamesnvc/msgpack/releases/*.zip |
No reviews. Create the first review!.
Version | SHA1 | #Downloads | URL |
---|---|---|---|
0.1.0 | 7167174e70c4b8fef842df67361ba08012c48762 | 1 | https://github.com/jamesnvc/msgpack/archive/v0.1.0.zip |
0.1.2 | 1f7beecf966d344299cf511f6e70d48aeda19a99 | 1 | https://github.com/jamesnvc/msgpack/archive/v0.1.2.zip |
0.1.4 | 5c50c0762da27a80b623394981e95d890a26fe50 | 2 | https://github.com/jamesnvc/msgpack/archive/v0.1.4.zip |
0.1.5 | 708629987ad26a5d0d6b976a1eb63c1db9a31824 | 2 | https://api.github.com/repos/jamesnvc/msgpack/zipball/v0.1.5 |
0.1.6 | 6e5b3c2f5aa179564fe4b7acd12213c88806d833 | 26 | https://api.github.com/repos/jamesnvc/msgpack/zipball/v0.1.6 |
This library provides a DCG, msgpack//1 for the parsing of MessagePack.
It can be used to either pack or unpack MessagePack data structures to/from bytes.
It is available from the SWI Prolog registry and can be installed via ?- pack_install(msgpack).
.
Unpacking:
?- Bytes = [0x82, 0xa3, 0x66, 0x6f, 0x6f, 0x1, 0xa3, 0x62, 0x61, 0x72, 0x94, 0xcd, 0xf, 0xff, 0xc3, 0xc2, 0xc0], msgpack(Data, Bytes, []). Data = dict([str("foo")-1, str("bar")-list([4095, true, false, none])]).
Packing:
?- msgpack(list([-32, str("bloop"), list([65, 129, 2000])]), Bytes, []), format_hex_list(Bytes). Bytes = [147, 208, 224, 165, 98, 108, 111, 111, 112|...].
Pack contains 5 files holding a total of 25.1K bytes.