javascript - How do I unpack a data from a binary string in Node.js?

one text

Solution:

Checkout this snippet:

 const buf = Buffer.from("1Xr5WEtvrApEByOh4GtDb1nDtls", 'base64')
 const uint32array =  new Uint32Array(buf.buffer, buf.byteOffset, buf.length / Uint32Array.BYTES_PER_ELEMENT)
 // Variable uint32array presents:
 // Uint32Array(5) [
 // 1492744917,
 // ... ]

The documentation about Nodejs TypedArray is here: Nodejs Buffer

Source