blah-code
Version:
Encode and decode blah code.
3 lines • 1 kB
JavaScript
/*! blah-code - v2.0.1 - https://bullg.it/blah-code - MIT License */
!function(o,r){"use strict";"function"==typeof define&&define.amd?define([],function(){return o.blahCode=r()}):"object"==typeof exports?module.exports=r():o.blahCode=r()}(this,function(){"use strict";var o={blah:["bleh","blah","bluh","blaah","bleeh","bluuh","blehh","blaa","blahh","blee"],ooks:["Ook","Ook?","Ook!","Ook?!","Ook!?","Oook","Oook?","Oook!","Oook?!","Oook!?"]},r=function(r,e){var n=[];e=void 0===e?"blah":e;for(var t in r)if(r.hasOwnProperty(t)){var i=[],a=r[t].charCodeAt(0).toString().split("");for(var h in a)a.hasOwnProperty(h)&&i.push(o[e][a[h]]);n.push(i.join(" "))}return n.join(". ")},e=function(r,e){var n=[];e=void 0===e?"blah":e;var t=r.split(". ");for(var i in t)if(t.hasOwnProperty(i)){var a=t[i].split(" "),h=[];for(var u in a)a.hasOwnProperty(u)&&h.push(o[e].indexOf(a[u]));n.push(String.fromCharCode(h.join("")))}return n.join("")};return{encode:r,decode:e}});
//# sourceMappingURL=blah-code.min.js.map