This file contains hidden or 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
/** | |
* string to unicode | |
*/ | |
const strToUnicode = (str) => { | |
return Array.from(str) | |
.map((char) => { | |
const codePoint = char.codePointAt(0); | |
// For code points less than 0xFFFF, use `padStart` to ensure that | |
// the code point is at least four characters in length, and pad with zeros at the front. |