string2num is a super-simple npm package for encoding strings into integers and decoding them.
const s2n = require('string2num');s2n.encode('hello world!')
// returns 080512121500231518120439 as a strings2n.decode('080512121500231518120439')
// returns 080512121500231518120439string2num was specifically designed to allow Scratch users to communicate with servers and between clients using number-restrcited cloud variables. If you are using this in the context of Scratch, download the charmap array here or if you're looking for a simplified approach, just remix the existing project and go from there.