Just copy the necessary functions into your JavaScript. In a suitable place do
<script type="text/javascript">
document.write(ROT47("string"));
</script>
necessary functions:
function ROTn(text, map) {
var R = new String()
var i, j, c, len = map.length
for(i = 0; i < text.length; i++) {
c = text.charAt(i)
j = map.indexOf(c)
if (j >= 0) {
c = map.charAt((j + len / 2) % len)
}
R = R + c
}
return R;
}
function ROT47(text) {
var R = new String()
R = ROTn(text,
"!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~")
return R;
}
source
share