Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
Javascript Blob of Uint8 and Uint16

is there a shorter / faster way of extracting the byte data of a blob composed of a uint8 followed by 2 uint16?

im currently extracting this way:

/**
* is there a faster way to do this??
*/
async function handleResponse( blob )
{ 
  const obuff         = await blob.arrayBuffer()   

  var arr1            = new Uint8Array( obuff.slice(0,1) );
  var arr2            = new Uint16Array( obuff.slice(1) );
 
  console.log( arr1[0], arr2[0], arr2[1] )
}

// simulating a blob returned from the server...
const blobFromTheServer = new Blob([  
                        Uint8Array.of(1),
                        Uint16Array.of( 2345, 6789 ) 
                    ])  

handleResponse( blobFromTheServer )

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!