A Go language binding for encodeing and decoding data in the bencode format that is used by the BitTorrent peer-to-peer file sharing protocol.
Branch: master
Clone or download
jackpal Use quotes so 1.10 is interpreted correctly
Without quotes it's parsed as "1.1".
Latest commit 227668e Aug 13, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis.yml Use quotes so 1.10 is interpreted correctly Aug 13, 2018
LICENSE Initial commit Jan 6, 2010
README.md Fix headers Aug 11, 2018
benchmark_test.go Speed up decoding. Aug 13, 2018
bencode_test.go Fix typo in method name. Aug 11, 2018
decode.go Speed up decoding. Aug 13, 2018
incswparse.go Speed up decoding. Aug 13, 2018
parse.go Speed up unmarshaling. Aug 12, 2018
struct.go Speed up unmarshaling. Aug 12, 2018

README.md

bencode-go

A Go language binding for encoding and decoding data in the bencode format that is used by the BitTorrent peer-to-peer file sharing protocol.

Quick Start

Get the package

go get -u github.com/jackpal/bencode-go

Import the package

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

Unmarshal a bencode stream into an object

data := myAwesomeObject{}
err := bencode.Unmarshal(reader, &data)

Decode a bencode stream

data, err := bencode.Decode(reader)

Encode an object into a bencode stream

err := bencode.Marshal(writer, data)

Complete documentation

http://godoc.org/github.com/jackpal/bencode-go

License

This project is licensed under the Go Authors standard license. (See the LICENSE file for details.)