jeudi 31 janvier 2019

Fetch Uint16 from readable stream

In the following example I'm fetching 2 raw bytes.

fetch('https://www.random.org/cgi-bin/randbyte?nbytes=2')
    .then(response=>response.body.getReader())
    .then(reader=>0/*Here convert to Uint16*/)

Any idea how to convert the resulting readable stream Uint16 integer from using 2 bytes?




Aucun commentaire:

Enregistrer un commentaire