For example if I pass any 8 digit number say 97895614 then it should return some 4 digit number (it can be alphanumeric) in a way that it corresponds only to that passed 8 digit number.
I made a function that takes any 8 digit number as an argument
For example if I pass any 8 digit number say 97895614 then it should return some 4 digit number (it can be alphanumeric) in a way that it corresponds only to that passed 8 digit number.
I made a function that takes any 8 digit number as an argument
You can use the String.fromCharCode method for the string prototype : https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode.
But since you use 2 digits per 'char' you will be limited in the output characters to the first 100 UTF-16 characters.
i.e :
If you need to output a specific set of characters you'll have to add a calculation on top of your input digits, to only include this set.