diff --git a/Scripts/DIGI2ASCII.js b/Scripts/DIGI2ASCII.js new file mode 100644 index 00000000..07579b4f --- /dev/null +++ b/Scripts/DIGI2ASCII.js @@ -0,0 +1,24 @@ +/** +{ + "api": 1, + "name": "Digi to ASCII", + "description": "Digi to ASCII", + "author": "Joseph Ng Rong En", + "icon": "dice", + "tags": "ascii,digi" +} +**/ + +function digi2a(str) { + var split = str.split(/[ ,]+/); + var arr = []; + for (var i = 0, l = split.length; i < l; i ++) { + var ascii = String.fromCharCode(split[i]); + arr.push(ascii); + } + return arr.join(''); +} + +function main(input) { + input.text = digi2a(input.text); +} \ No newline at end of file