Code to compress and decompress timestamp series