Anonymous user
Vigenère cipher: Difference between revisions
m
→{{header|Rust}}
(→{{header|TXR}}: Much shorter Lisp code is now possible.) |
|||
Line 2,282:
let mut result_bytes = ~[];
for (i, c) in text_bytes.iter().enumerate() {▼
▲ for c in text_bytes.iter() {
let c2 = if is_encoding {
(c + key_bytes[i % key_bytes.len()] - 2 * A) % 26 + A
Line 2,290 ⟶ 2,289:
};
result_bytes.push(c2);
}
|