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

159
Views
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 answers
Answer question

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 Report

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 Report

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 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!