transp_shuffle

Function transp_shuffle 

Source
pub fn transp_shuffle(key: &str, alphabet: &str) -> Result<String>
Expand description

Shuffles an alphabet using a keyword to create a mixed alphabet for cipher use.

BTW: the transposition comment about shuffle was coming from the Go version… and is wrong.

The main issue with plain shuffle() is that the first letter in the final alphabet is always the same as the key. This version does not have this problem.

This optimized version performs transposition directly without creating intermediate objects, making it as fast as the plain shuffle, if not faster.

inlining FTW :)