Ward Posted January 8, 2015 Share Posted January 8, 2015 (edited) Introduction"MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller." (by http://msgpack.org/).There are already so many languages support MessagePack format, here comes AutoIt version. The backend coder is Charlie Gunyon's cmp. It supported MessagePack proposal v5.This UDF only have two public functions: MsgPack_Pack() and MsgPack_Unpack(). It just like Json_Enocde() and Json_Decode() in my ?do=embed' frameborder='0' data-embedContent>>JSON UDF. The Map type will be decoded into "Windows Scripting Dictionary Object" retuned from ObjCreate("Scripting.Dictionary"). So I suggest using Json.au3 to deal with the Map/Object data type. The main difference is MessagePack support Binary format, but Json not. For example (?do=embed' frameborder='0' data-embedContent>>Json.au3 is required to run this example):Local $Obj1 Json_Put($Obj1, ".binary", Binary("0x00")) Json_Put($Obj1, ".string", "abc") Json_Put($Obj1, ".int", Random(0, 1000, 1)) Json_Put($Obj1, ".float", Random()) Json_Put($Obj1, ".bool", True) Json_Put($Obj1, ".null", Null) Local $Binary = MsgPack_Pack($Obj1) Local $Obj2 = MsgPack_Unpack($Binary) ConsoleWrite("Test2 $Obj1.binary is " & VarGetType(Json_Get($Obj2, ".binary")) & @LF) ; "Binary"In my opinion, for human readable data storing or exchanging, of course choose Json. Otherwise, especially to exchange data on the internet, MessagePack may be a better choice. MsgPack.zip Edited November 23, 2015 by Ward MagicSpark, argumentum and KaFu 3 新版 _ArrayAdd 的白痴作者,不管是誰,去死一死好了。 Link to comment Share on other sites More sharing options...
Taz77 Posted March 17, 2016 Share Posted March 17, 2016 The zip is unavailable for download. Does any one know where I can get it? Dropbox - Sign up and get an extra 500MB Link to comment Share on other sites More sharing options...
argumentum Posted March 18, 2016 Share Posted March 18, 2016 6 hours ago, Taz77 said: The zip is unavailable for download. Does any one know where I can get it? MsgPack.zip Taz77 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Taz77 Posted March 18, 2016 Share Posted March 18, 2016 3 hours ago, argumentum said: MsgPack.zip Thanks :) argumentum 1 Dropbox - Sign up and get an extra 500MB Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now