rencode in Go

gdm85
1 min readOct 25, 2015

--

This morning I was looking for a Go implementation of rencode, the Web safe object pickling/unpickling library originally written in Python (original implementation by C. Barnes can be read here: http://www.connellybarnes.com/code/python/rencode).

It is basically a simplified bencode implementation, that shortcuts a few bytes on small numbers and small lists/dictionaries.

It can be useful for example to communicate as a Go native client with Twisted RPC servers, and although you could also write a compatible server with it I would suggest to use JSON/RPC or gob/gRPC these days for a modern RPC server.

Courtesy of Loving learning blog.

Since I found no existing Go implementation of rencode, I wrote a Go one based on Andrew Resch’ Cython implementation.

Here it is, complete with godoc documentation:

https://github.com/gdm85/go-rencode

--

--

gdm85

Thinker, software developer, cryptography passionate and an avid reader of science and technology.