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

181
Views
Cómo agregar un Byte a una secuencia de escape hexadecimal en JS

Tengo un pequeño problema con javascript y como no tengo un nivel muy alto, necesitaría ayuda por favor.

Demostración con hachís

En realidad, tengo una "cadena" de bytes que tengo que codificar. El problema es que tengo que agregarle otro byte que genero en un script. No puedo agregar este de una sola vez (es decir, haga "+ '\x25'") porque tengo que agregar primero el primer dígito y luego el segundo. Pero cuando concateno el nuevo byte, se interpreta como 4 caracteres en lugar de uno, a saber, "\", "x", "2", "5" en lugar de "%". ¿Habría alguna forma de agregar el byte sin traducirlo a ASCII?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Prueba esto:

 const firstDigit = 2; const secondDigit = 5; const number = `${firstDigit}${secondDigit}`; const charToAdd = String.fromCharCode(Number.parseInt(number, 16)); console.log(charToAdd);

about 4 years ago · Juan Pablo Isaza Report
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!