Created
April 9, 2017 18:49
-
-
Save gtrabanco/eaead69788c9339ed0a79197b94a29b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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