Skip to content

Instantly share code, notes, and snippets.

@gtrabanco
Created April 9, 2017 18:49
Show Gist options
  • Save gtrabanco/eaead69788c9339ed0a79197b94a29b7 to your computer and use it in GitHub Desktop.
Save gtrabanco/eaead69788c9339ed0a79197b94a29b7 to your computer and use it in GitHub Desktop.
var dec = function (arr) {
var result = '';
arr.forEach(function (v) {
var letter = String.fromCharCode(parseInt(parseInt(v,16).toString(10)));
result += letter;
});
return result;
};
var enc = function (str) {
var result = [];
str.split('').forEach(function (v) {
result.push(parseInt(v.charCodeAt()).toString(16));
});
return result;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment