Convert a binary string to big endian integer in the browser?
I have the following string in binary : const bin = ‘\x00\x00\x16%’ I’d like to convert it in big endian integer. I was able to do it using the following: new DataView(Uint8Array.from(‘\x00\x00\x16%’, c => c.charCodeAt(0)).buffer).getInt32(0, false) => 5669 But I’m pretty sure there is asimpler way to do so, rather than convert to an Uint8Array… Read More Convert a binary string to big endian integer in the browser?