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

235
Vistas
Use JSON.stringify() or any other method to serialize without removing Whitespaces -Javascript

I have a Json let obj = {"a": "1", "b" : "2"} which contain whitespaces. I want to serialize the obj without removing the whitspaces, So that when i deserialize (EX: using JSON.parse()), i should be able to get the obj in same format.

let obj = {"a":   "1",  "b" :    "2"};
let serialized_obj = JSON.stringify(obj);
//then we get  serialized_obj  = "{"a":"1","b":"2"}" , this shouldn't happen.

What is Expected?

let obj = {"a":   "1",  "b" :    "2"};
let serialized_obj = serializationMethod(obj);
// expected to get serialized_obj  = "{"a":   "1",  "b" :    "2"}"
let deserialized_obj = deserializationMethod(serialized_obj);
//expected to get serialized_obj  = {"a":   "1",  "b" :    "2"}

Require the methods serializationMethod() and deserializationMethod()

More Details For security reasons i get the JSON object and the digital signature of the serialized object. i have to verify the both. I can get these from any of the technology user. But the problem i faced is, in python serialization the json is beautified with whitespaces. So when i get them, i am not able to keep the format i got and verificaton fails.

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