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

276
Vistas
Why does atob fail in Safari and Chrome on this Base 64 string?

Here is an example bit of Javascript to reproduce the issue:

let a = "qNqrdXUrk5S7dCM1MAYH3qSVDXznb-6prQoGqiACR10=";
console.log(atob(a));

In Safari we get:

Invalid Character Error: the string contains an invalid character.

In Chrome we get:

Uncaught DOMException: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.

I can decode the above string on base64decode.org. By the way the value is intended to be a random sequence of bytes, not any sort of human readable string. atob ought to handle that.

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

0

From the "Design" section of that same page:

MIME's Base64 implementation uses A-Z, a-z, and 0-9 for the first 62 values, as well as "+" and "/" for the last two. Other variations, usually derived from Base64, share this property but differ in the symbols chosen for the last two values; an example is the URL and filename safe "RFC 4648 / Base64URL" variant, which uses "-" and "_".

JS uses the MIME-based encoding, and therefore the - in your initial string is invalid. It likely works on the decoder on the site by detecting which characters are in the input string and choosing the proper decoding format versus blindly using atob().

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