To convert a string to a utf8-encoded hex string in node.js: > Buffer.from('s2').toString('hex') '7332' > Buffer.from('s3').toString('hex') '7333' > Buffer.from('s4').toString('hex') '7334'