I had trouble using String.fromCharCode in JavaScript(I used it in browser and nodejs), When the parameter was less than 128, I got the same result, but when it was over 128, the result of nodejs was wrong. here is the code and the result in browser:
window.btoa(String.fromCharCode(127))
in nodejs:
Buffer.from(String.fromCharCode(127)).toString('base64')
so, how can I get the right result with nodejs code?