Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9204095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:37:34+00:00 2026-06-17T23:37:34+00:00

I was implementing password hashing with salt, so I generated salt as binary, hashed

  • 0

I was implementing password hashing with salt, so I generated salt as binary, hashed the password, base64 encoded the password and salt then stored them into database.

Now when I am checking password, I am supposed to decode the salt back into binary data, use it to hash the supplied password, base64 encode the result and check if the result matches the one in database.

The problem is, I cannot find a method to decode the salt back into binary data. I encoded them using the Buffer.toString method but there doesn’t seem to be reverse function.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:37:36+00:00Added an answer on June 17, 2026 at 11:37 pm

    As of Node.js v6.0.0 using the constructor method has been deprecated and the following method should instead be used to construct a new buffer from a base64 encoded string:

    var b64string = /* whatever */;
    var buf = Buffer.from(b64string, 'base64'); // Ta-da
    

    For Node.js v5.11.1 and below

    Construct a new Buffer and pass 'base64' as the second argument:

    var b64string = /* whatever */;
    var buf = new Buffer(b64string, 'base64'); // Ta-da
    

    If you want to be clean, you can check whether from exists :

    if (typeof Buffer.from === "function") {
        // Node 5.10+
        buf = Buffer.from(b64string, 'base64'); // Ta-da
    } else {
        // older Node versions, now deprecated
        buf = new Buffer(b64string, 'base64'); // Ta-da
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not sure how password hashing works (will be implementing it later), but need
I am implementing a password reset function and would have the key I want
i am having difficulty implementing phpass into my login procedure - not knowing how
I'm implementing a password change feature in my web application. The old password is
I am implementing a system where the user can Reset their password if they
How do I go about implementing a secure password reset function without sending the
I'm working on implementing the code suggested here: Enforcing password strength requirements with django.contrib.auth.views.password_change
We're using Spring jdbcTemplate for implementing the service layer right now but at some
I am implementing a reset password aspx page and in that page, I am
I'm implementing a simple password store using Blowfish. All was fine until I tried

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.