Basic encode and decoder for data.