what is reserved bits?
It is completely unclear for me how encode/decode data, because it is unclear where paritiy bits stored.
/// Unless you use the `no-panics` feature, encoding will also panic if the data you try to encode has some
/// bits set to 1 in the reserved space, or past the `encodable_size() + code_size()` rightmost bits
What is "reserved space", is it actually space for hamming code (SecDedCodec::code_size) or there are some other
reserved bits, like code_size for single error correction , and somewhere else there is double error detection bit?
for example:
fn how_it_works() {
let secded = SecDed64::new(56);
println!("code_size {}", secded.code_size());
let before: [u8; 8] = [255, 255, 255, 255, 255, 255, 255, 0];
let mut buf: [u8; 8] = before;
secded.encode(&mut buf);
secded.decode(&mut buf).unwrap();
assert_eq!(before, buf);
}
reports "is too big to be encoded on 63 bits", but at the same time, if I replace 56 with 57 all works fine.
It is really strange why it can encode/decode 57/64, but can not 56/64.
I suppose in both cases (57, 56) it need 6 bits for SEC, and 1 bit for DEC. So it should work for both cases.
cc @p-avital
Edited by Evgeniy Dushistov