nl_tokens: Converts a code point to a surrogate pair . Conversion algorithm is taken from The Unicode Standard 3 . 0 Section 3 . 7 ( https : // www . unicode . org / versions / Unicode3 . 0 . 0 / ch03 . pdf )
pl_tokens: function getSurrogatePairFromCodePoint ( codePoint ) { const lead = Math . <mask> ( ( codePoint - 0x10000 ) / 0x400 ) + 0xd800 ; const trail = ( codePoint - 0x10000 ) % 0x400 + 0xdc00 ; return { lead : lead . toString ( 16 ) , trail : trail . toString ( 16 ) } ; }