bencode encoder and decoder