Mangler
const lookupReplacements = {
// entities (like ∑ or Θ - are safer
// than just putting things inline like ∑ or ®
'a': ['A', 'Ä', '∆', 'á'],
'e': ['é', '∃'],
't': ['⊤', 'Τ'] ,
'b': ['β'],
'o': ['∅', '_o_']
}
function mangle(s) {
return s.split``.map(letter => {
const chars = lookupReplacements[letter]
return chars ? chars[
Math.floor(
chars.length * Math.random()
)
] : letter
}).join``
}
document.body.innerHTML = mangle('Been taking a break from making snippets... might start up again...<hr>')
document.body.innerHTML += mangle('Been taking a break from making snippets... might start up again...<hr>')
document.body.innerHTML += mangle('Been taking a break from making snippets... might start up again...<hr>')
Substitute some characters in a string with some random choices…