Vigenère cipher/Cryptanalysis: Difference between revisions

Content added Content deleted
Line 2,145: Line 2,145:
=={{header|Rust}}==
=={{header|Rust}}==
{{trans|Kotlin}}
{{trans|Kotlin}}
Note that the character to/from byte ('''u8''') conversions work here only because the key and cryptogram are composed of ASCII characters. Indeed, Rust's '''char''' type is a ''Unicode scalar value'', how they are represented is well summarized in the Rust book's [https://doc.rust-lang.org/std/primitive.char.html subchapter on strings].
Note that the character to/from byte ('''u8''') conversions work here only because the key and cryptogram are composed of ASCII characters only. Indeed, Rust's '''char''' type is a ''Unicode scalar value'', how they are represented is well summarized in the Rust book's [https://doc.rust-lang.org/std/primitive.char.html subchapter on strings].
<lang Rust>
<lang Rust>
use std::iter::FromIterator;
use std::iter::FromIterator;