msgpack-arbitrary-0.1.2: A Haskell implementation of MessagePack.
Safe HaskellSafe
LanguageHaskell2010

Test.MessagePack.Parser

Description

A MessagePack parser.

Example usage: $ echo -ne "x94x01xa1x32xa1x33xa4x50x6fx6fx66" | ./msgpack-parser or $ echo 'ObjectArray [ObjectInt 97, ObjectStr "test", ObjectBool True]' | ./msgpack-parser

This tool performs two symmetrical functions: 1. It can decode binary data representing a Data.MessagePack.Object into a human-readable string. 2. It can do the reverse: encode a human-readable string into a binary representation of Data.MessagePack.Object.

No flags are required as it automatically detects which of these two functions it should perform. This is done by first assuming the input is human readable. If it fails to parse it, it then considers it as binary data.

Therefore, given a valid input, the tool has the following property $ .msgpack-parser < input.bin | .msgpack-parser will output back the contents of input.bin.

In case the input is impossible to parse, nothing is output.

Known bugs: - If no input is given, the tool exits with "Data.Binary.Get.runGet at position 0: not enough bytes" - The tool does not check that all the input is parsed. Therefore, "abc" is interpreted as just "ObjectInt 97".

Documentation