Fixed checksum calculation and encoding/decoding