Skip to content

Commit

Permalink
Merge pull request #1 from jnre/feature/digi2ascii
Browse files Browse the repository at this point in the history
digi 2 ascii conversion
  • Loading branch information
jnre authored Nov 25, 2020
2 parents 5144567 + 179094d commit 948500e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Scripts/DIGI2ASCII.js
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 948500e

Please sign in to comment.