Replace fixed length `Vec<u8>` with a `[u8; LEN]` array to avoid heap allocation It also has some duplicate code in encoder impl