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 6752135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:00:33+00:00 2026-05-26T13:00:33+00:00

I am trying to get the same result I obtain at http://jssha.sourceforge.net/ where I

  • 0

I am trying to get the same result I obtain at http://jssha.sourceforge.net/

where

I have the word ‘testing’ in question:

var word = 'testing';
var hex = toHex(word); // '740065007300740069006e006700';

on jssha when selecting input type as HEX with the value of the hex variable and SHA-512 I get the following result:

6e42b2c2a6351036b78384212774135d99d849da3066264983e495b5f74dc922e3d361b8ea9c8527169757233ed0bd4e56b2c42aab0a21bbcca67219dc53b472

although I can’t achieve the same result with nodejs crypto module.

require('crypto').createHash('sha512').update(hex).digest('hex')

outputs:

9ad6d9053c6c420fe61ec2fffd094e3a325bc71708e18232fd764a5eb30315e38464e620ef0b55b92fbf6c809838652a72d9412b0398b28d61ca432962451de2

So I am wondering how can I get the same result as jssha using crypto module?

Thanks

  • 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-05-26T13:00:34+00:00Added an answer on May 26, 2026 at 1:00 pm

    “testing” in hex is 74657374696e67 if you use utf8 which is pretty much standard. What your toHex method returns assumes utf16.

    For that hash, the website says:

    521b9ccefbcd14d179e7a1bb877752870a6d620938b28a66a107eac6e6805b9d0989f45b5730508041aa5e710847d439ea74cd312c9355f1f2dae08d40e41d50
    

    Do this in node.js to hash a hex string:

    require('crypto').createHash('sha512').update(
      new Buffer("74657374696e67", "hex")
    ).digest('hex')
    

    Node gives you the same hash. Oh, and this also gives you the same hash:

    require('crypto').createHash('sha512').update("testing").digest('hex')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get the same result of a .NET application (see the link
I'm trying to get a button which looks exactly the same whether it is
I'm trying to get it to verify that it has the same item in
I'm trying to get the def wfsc_pod1 and wfsc_ip into the same def. I'm
Trying to get this example working from http://www.munna.shatkotha.com/blog/post/2008/10/26/Light-box-effect-with-WPF.aspx However, I can't seem to get
Trying to get comfortable with jQuery and I have encountered some sample code that
I have been trying to get the following code to work(everything is defined in
I'm trying to get an ASP.NET website running on Vista (IIS7), using SQL Server
I have been trying this formula to obtain the azimut/bearing of two points of
I have been trying CSS columns, but I can't get breaks to work. Here's

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.