/go-bencode

Bencode package for golang

Primary LanguageGoMIT LicenseMIT

go-bencode

Software License Build Status Coverage Status Go Report Card Go Doc

Installation

go get github.com/IncSW/go-bencode

import bencode "github.com/IncSW/go-bencode"

Quick Start

data, err := Marshal(value)
data, err := Unmarshal(value)

Performance

Go 1.11, Debian 9.1, i7-7700

Marshal

Library Time Bytes Allocated Objects Allocated
IncSW/go-bencode 717 ns/op 528 B/op 3 allocs/op
marksamman/bencode 924 ns/op 448 B/op 8 allocs/op
chihaya/bencode 1833 ns/op 1010 B/op 52 allocs/op
jackpal/bencode-go 4984 ns/op 2128 B/op 56 allocs/op
zeebo/bencode 5214 ns/op 1488 B/op 44 allocs/op

Unmarshal

Library Time Bytes Allocated Objects Allocated
IncSW/go-bencode 1742 ns/op 1344 B/op 41 allocs/op
jackpal/bencode-go 🠅2 2565 ns/op 1712 B/op 59 allocs/op
chihaya/bencode 2913 ns/op 5968 B/op 61 allocs/op
marksamman/bencode 🠇2 3173 ns/op 5920 B/op 66 allocs/op
zeebo/bencode 7533 ns/op 6576 B/op 99 allocs/op

License

MIT License.