Function digital_encipher

Source
pub fn digital_encipher(msg: String, n: i32) -> Vec<i32>
Expand description

Digital Cypher assigns to each letter of the alphabet a unique number. Instead of letters in encrypted word we write the corresponding number. Then we add to each obtained digit consecutive digits from the key. Write a function that accepts string and key number and returns an array of integers. Write the Encipher function.

ยงExample

encipher("scout",1939)
returns [ 20, 12, 18, 30, 21]