zeebo/bencode

Add EncodeBytes and DecodeBytes functions

cenkalti opened this issue · 2 comments

There are helper functions for encoding and decoding strings but not for bytes:

func DecodeString(in string, val interface{}) error
func EncodeString(val interface{}) (string, error)

If you don't have any objection, I would like to implement

func DecodeBytes(b []byte, val interface{}) error
func EncodeBytes(val interface{}) ([]byte, error)

functions and send you a pull request, OK?

Sounds good to me as long as you also add yourself to the AUTHORS file and agree to license the code under the LICENSE.

Fixed via 0c08b57