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

165
Vistas
How Can I display points instead of password with reactJs?

actually I want to display the users from my db in a table..I have a password that I want to display points instead of it..anyone could help me doing this? this how I display the password

      <td> <Lock size={14} color=" #273746 " /> &nbsp; {item.password}</td>

I would be very thankful if anyone of you can help mee

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

0

If you want to generate a string of asterisks with the same length as the original string (e.g. item.password), then you can utilize the String.prototype.repeat method:

"*".repeat("mysecretpassword".length); // "****************"

However, I would advise showing a constant number of asterisks not related to the passwords because it is significantly easier to hack a password if a malicious person knew the number of characters was in it by counting the asterisks if they had, for example, taken a picture of the hidden passwords list. Therefore, I think you're best bet would be to just hard code a certain number of asterisks and show it for all of the passwords:

"**********"
about 4 years ago · Juan Pablo Isaza Denunciar

0

answers above look correct but I just need to remember you that you shouldn't ever get text/plain passwords from your API. further, you shouldn't keep passwords in text/plain on database. if you really need to keep them in text/plain form, you already need to mask them on back-end before sending them to the client (front-end).

about 4 years ago · Juan Pablo Isaza Denunciar

0

You can use Javascript string replace function. You can find it here : https://www.w3schools.com/jsref/jsref_replace.asp

{item.password.replace({item.password}, "**********")}

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