• Stars
    star
    70
  • Rank 447,840 (Top 9 %)
  • Language
    Elixir
  • Created almost 12 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

MessagePack Implementation for Elixir / msgpack.org[Elixir]

MessagePack for Elixir

Build Status

Installation

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

defp deps do
  [{:message_pack, "~> 0.2.0"}]
end

Usage

# pack
MessagePack.pack([1,2,3]) #=> { :ok, <<147,1,2,3>> }
MessagePack.pack!([1,2,3]) #=> <<147,1,2,3>>

# unpack
MessagePack.unpack(<<147,1,2,3>>) #=> { :ok, [1,2,3] }
MessagePack.unpack!(<<147,1,2,3>>) #=> [1,2,3]

# unpack_once
MessagePack.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

More Repositories

1

exenv

Elixir versions management tool
Shell
277
star
2

elixir-build

Elixir version of ruby-build
Shell
99
star
3

mongoex

Elixir ODM-like module for MongoDB
Elixir
54
star
4

zstd-erlang

Zstd binding for Erlang/Elixir
C
41
star
5

rafute

An implementation of Raft Consensus Algorithm in Elixir
Elixir
20
star
6

capybara-user_agent

DSL for handling UserAgent on Capybara
Ruby
16
star
7

elixir-mustache

Mustache for Elixir
Elixir
16
star
8

erlang-mruby

[WIP] mruby on erlang
C
15
star
9

omniauth-hatena

A Strategy to auth with Hatena in OmniAuth
Ruby
11
star
10

fifocache

FIFO cache implementation in Erlang
Erlang
10
star
11

elixir-random

Random for Elixir.
Elixir
10
star
12

gshogi

Go
8
star
13

msgpack-rpc-elixir

msgpack-rpc-elixir
Elixir
7
star
14

elixir-calendar

A date and time library for Elixir.
Elixir
4
star
15

fluent-logger-elixir

fluent-logger-elixir
Elixir
4
star
16

damm

An Erlang implementation of the Damm algorithm
Erlang
3
star
17

prometheus-td-adapter

Prometheus remote storage adapter for Treasure Data
Go
3
star
18

tiny_segmenter.ex

Elixir Implementation of tiny_segmenter.js
Elixir
2
star
19

verhoeff

An Erlang implementation of the Verhoeff algorithm
Erlang
2
star
20

exdatetime

Elixir
2
star
21

renoir-search-elixir

this is a clone of http://renoir-search.herokuapp.com which is my rails app
JavaScript
2
star
22

fuji

MQTT Gateway Fuji
Go
1
star
23

ex_unit_emoji

An Emoji Formatter for ExUnit.
Elixir
1
star
24

tracer

Elixir
1
star
25

holidayjp

for holidays in Japan
Elixir
1
star
26

tracer_sample

Elixir
1
star
27

mckee

Elixir
1
star
28

trace_monitor

Elixir
1
star
29

ex_unit_parameterize

parameterized test syntax for ExUnit
Elixir
1
star
30

wsgat

WebSocket cat
Go
1
star
31

amida

amida gem
Ruby
1
star
32

ac2013

sample
Erlang
1
star