Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

69 Commits

Repository files navigation

MessagePack for Elixir

Build Status

Installation

Add :message_pack as a dependency in your mix.exs file.

defpdepsdo[{:message_pack,"~> 0.2.0"}]end

Usage

# packMessagePack.pack([1,2,3])#=> { :ok, <<147,1,2,3>> }MessagePack.pack!([1,2,3])#=> <<147,1,2,3>># unpackMessagePack.unpack(<<147,1,2,3>>)#=> { :ok, [1,2,3] }MessagePack.unpack!(<<147,1,2,3>>)#=> [1,2,3]# unpack_onceMessagePack.unpack_once(<<147,1,2,3,4>>)#=> {:ok, {[1, 2, 3], <<4>>}}MessagePack.unpack_once!(<<147,1,2,3,4>>)#=> {[1, 2, 3], <<4>>}

Options

  • enable_string

Support string type. This options is false by default.

iex(1)>{:ok,bin}=MessagePack.pack(<<255>>){:ok,<<161,255>>}iex(3)>MessagePack.unpack(<<161,255>>){:ok,<<255>>}iex(4)>MessagePack.unpack(<<161,255>>,enable_string: true){:error,{:invalid_string,<<255>>}}
  • ext

Support extention type.

See test/message_pack_ext_test.exs.

License

MIT

About

MessagePack Implementation for Elixir / msgpack.org[Elixir]

Resources

Stars

71 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages