When i run the punycode.ucs2.decode
("This is a message with emoji ⚽ ⛄ ) ")
I'm obtaining numbers greater than 0xFFFF (65536) in codes. That causes me a problem because i need to convert this into a paddedHexString. So i have to pad the string to 6 digits when i am receiving that emojis.
It looks like it is happening with secondary set of emojis in the document.
http://www.unicode.org/Public/emoji/1.0/emoji-data.txt
Function that breaks
function toPaddedHexString(num, len) {
const str = num.toString(16).toUpperCase();
return "0".repeat(len - str.length) + str;
}