Sha256: 6606d066a64a649c569c923698d582586c20272b1fdfd964a3bed30eb4ed1c29
Contents?: true
Size: 569 Bytes
Versions: 323
Compression:
Stored size: 569 Bytes
Contents
package Example; use strict; use warnings; sub encode { my $plaintext = shift; # normalize (my $cipher = $plaintext) =~ s/[^\p{Alnum}]//g; $cipher = lc $cipher; # translate $cipher =~ tr/abcdefghijklmnopqrstuvwxyz/zyxwvutsrqponmlkjihgfedcba/; # wordify $cipher =~ s/(\p{Alnum}{5})(?=\p{Alnum})/$1 /g; return $cipher; } sub decode { my $cipher = shift; (my $plaintext = $cipher) =~ s/[^\p{Alnum}]//g; $plaintext =~ tr/zyxwvutsrqponmlkjihgfedcba/abcdefghijklmnopqrstuvwxyz/; return $plaintext; } __PACKAGE__;
Version data entries
323 entries across 323 versions & 1 rubygems