Sha256: 3ad848cd07808c07ecec39afb355ef2d5277426725c8b977a8cfdeb18e6d1cd0
Contents?: true
Size: 559 Bytes
Versions: 220
Compression:
Stored size: 559 Bytes
Contents
function! AtbashDecode(cipher) abort return s:algorithm(s:normalize(a:cipher)) endfunction function! AtbashEncode(plaintext) abort return s:chunk(AtbashDecode(a:plaintext)) endfunction function! s:normalize(text) abort return substitute(tolower(a:text), '[^a-z0-9]', '', 'g') endfunction function! s:algorithm(text) abort let alphabet = 'abcdefghijklmnopqrstuvwxyz' let reversed = 'zyxwvutsrqponmlkjihgfedcba' return tr(a:text, alphabet, reversed) endfunction function! s:chunk(text) abort return join(split(a:text, '.\{5}\zs')) endfunction
Version data entries
220 entries across 220 versions & 1 rubygems