Skip to content

A simple library for parse and unmarshall the bencode format with some utilities.

License

Notifications You must be signed in to change notification settings

trixky/gobencode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gobencode

A simple library for parse and unmarshall the bencode format with some utilities.

Usage

Get the package

go get -u github.com/trixky/gobencode

Import the package

import bencode "github.com/trixky/gobencode"

Unmarshall from reader and get a bencode object

bc, err := gobencode.UnmarshallFromReader(reader)

Or parse and unmarshall manually only what you want

data, err := gobencode.ParseFromReader(reader)

if err != nil {
    return err
}

bc := gobencode.bencode.Bencode{
    Data: data
}

if err := bc.UnmarshallAnnounce(); err != nil {
    return err
}
if err := bc.UnmarshallAnnounceList(); err != nil {
    return err
}
if err := bc.RandomizeAnnounceList(); err != nil {
    return err
}
if err := bc.UnmarshallInfo(); err != nil {
    return err
}
if err := bc.GetInfoHash(); err != nil {
    return err
}

About

A simple library for parse and unmarshall the bencode format with some utilities.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages