Skip to content

Instantly share code, notes, and snippets.

@nipotan
Last active June 22, 2017 04:52
Show Gist options
  • Save nipotan/ec481452a4d65e3da99d3c8ff1ed50ae to your computer and use it in GitHub Desktop.
Save nipotan/ec481452a4d65e3da99d3c8ff1ed50ae to your computer and use it in GitHub Desktop.
derao - decrypt numeric ciphertext of natsu-no-rao
/*
日清ラ王 夏のラ王の数字の羅列を文字列に変換する
http://www.rao.jp/natsuno_rao/
*/
var pokebell = '0ワオン゛゜6789EアイウエオABCDJカキクケコFGHIOサシスセソKLMNTタチツテトPQRSYナニヌネノUVWX/ハヒフヘホZ?!-★マミムメモ¥&♥☎.ヤ(ユ)ヨ*# .5ラリルレロ1234';
var chars = pokebell.split('');
var charMap = [];
for (var i = 0; i < 10; i++) charMap.push(chars.splice(0, 10));
var deRao = function (pair, p, s) { return charMap[p][s] };
var textNodes = $('body').find('*').contents().filter(function(){return this.nodeType===3});
$.each(textNodes, function (i, node) {
node.nodeValue = $(node).text().replace(/(\d)(\d)/g, deRao);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment