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

159
Views
Cadena a hexadecimal TypedArray.map diferente de Array.from(TypedArray)

Cadena a hexadecimal es el objetivo. Obtener un resultado diferente cuando se usa el mapa directamente en un TypedArray en lugar de usar Array.from en TypedArray y luego usar el mapa. ¿Puede alguien ayudarme a entender lo que está pasando?

 var buf = new TextEncoder().encode('hello'); var ret = ''; for (var b of buf) ret += b.toString(16).padStart(2, '0').slice(-2); console.log( '\n', buf.join(), // 104,101,108,108,111 '\n', buf.map(x => x.toString(16).padStart(2, '0').slice(-2)).join(''), // 6865000 '\n', Array.from(buf).join(), // 104,101,108,108,111 '\n', Array.from(buf).map(x => x.toString(16).padStart(2, '0').slice(-2)).join(''), // 68656c6c6f '\n', ret, // 68656c6c6f '\n', decodeURIComponent('%' + ret.match(/.{1,2}/g).join('%')) // hello ); /* 104,101,108,108,111 6865000 104,101,108,108,111 68656c6c6f 68656c6c6f hello */
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!