Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

179
Vistas
How to add a Byte to an hexadecimal escape sequence in JS

I have a little problem with javascript and since I don't have a very high level, I would need some help please.

Demonstration with hash

Actually I have a "string" of bytes that I have to hash. The problem being that I have to add another byte to it that I generate in a script. I can't add this one all at once (ie do "+ '\x25'") because I have to add the 1st digit first and then the 2nd. But when I concatenate the new byte, it is interpreted as 4 character instead of one, namely "\", "x", "2", "5" instead of "%". Would there be a way to add the byte without translating it into ASCII?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try this:

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda