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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:15:14+00:00 2026-05-23T22:15:14+00:00

In node.js, I have: var h = crypto.createHash(md5); // md5 h.update(AAA); h.digest(hex); In PHP

  • 0

In node.js, I have:

var h = crypto.createHash("md5");   // md5
h.update("AAA");
h.digest("hex");

In PHP I have:

md5("AAA");

However, both have different value. How can I make it the same? or else, what other algorithm I should use to make them the same, so that I can use it as signature calculation. Thanks.


Oppss.. actually. my mistake. when I test it, there is a bug.. it will md5 the same thing.

  • 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-23T22:15:15+00:00Added an answer on May 23, 2026 at 10:15 pm

    Simple googling I did in the past gave me => http://japhr.blogspot.com/2010/06/md5-in-nodejs-and-fabjs.html

    Node.js

    Script:

    var crypto = require('crypto');
    var hash = crypto.createHash('md5').update('AAA').digest("hex");
    console.log(hash);
    

    Output:

    alfred@alfred-laptop:~/node/hash$ node hash.js 
    e1faffb3e614e6c2fba74296962386b7
    

    PHP

    Code

    <?php
    echo md5("AAA");
    

    Output:

    alfred@alfred-laptop:~/node/hash$ php md5.php 
    e1faffb3e614e6c2fba74296962386b7
    

    The output for both PHP and node.js are equal.

    C extension

    Also you might have look at https://github.com/brainfucker/hashlib which uses C implementation which is going to be faster.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have something like this: var xmlStatement:String = xmlObject.node[3].@thisValue; What mystery function do
I have a binary tree where each node can have a value. I want
I have simple node js http server. var http = require(http); http.createServer(function(request, response) {
I have written a http server using node js var sys = require(sys), http
I have a node.js module like this: # couchdb.js var couchdb = { //
I have this code: var nodeMap:Map[Int, List[Node]] = Map[Int, List[Node]]() nodeMap = Map[Int, List[Node]]()
I have been working with node and using vows to write tests. var vows
i have this problem to find a particular xml node l have post this
I want to have a tree in memory, where each node can have multiple
I have a node with many CCK fields. I want to hide a field

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.