Library for encoding and decoding data