Playfair cipher: Difference between revisions

Updated D entry
(Updated D entry)
(Updated D entry)
Line 195:
return _canonicalize(s)
.matchAll(r"(.)(?:(?!\1)(.))?".regex)
//.map!(m => enc[m[0].leftJustify(2, 'X')])
.map!(m => cast()enc[m[0].leftJustify(2, 'X')])
.join(" ");
}
Line 204 ⟶ 203:
.chunks(2)
//.map!dec
.map!(p => cast()dec[p.text])
.join(" ");
}