Giter Site home page Giter Site logo

Same hash for integer about node-md5 HOT 4 CLOSED

pvorb avatar pvorb commented on August 26, 2024
Same hash for integer

from node-md5.

Comments (4)

tobscher avatar tobscher commented on August 26, 2024 1

It looks like in its current state md5(12345) and md5('12345') will still return different results. I am wondering if this is due to the fact that Strings get converted into byte arrays and integers are not. What is the expected outcome?

from node-md5.

pvorb avatar pvorb commented on August 26, 2024

In its current state the algorithm expects strings or byte arrays as messages (see line 11). I should have noted that in the Readme.

Nevertheless, I should simply fix that behavior by adding a toString() for other values than string and byte array.

from node-md5.

pvorb avatar pvorb commented on August 26, 2024

Calling md5 with something different than strings or buffers is undefined behaviour.

Tobias Haar [email protected] schrieb:

It looks like in it's current state md5(12345) and md5('12345') will still return different results. I am wondering if this is due to the fact that Strings get converted into byte arrays and integers are not. What is the expected outcome?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#3 (comment)

from node-md5.

zneuron avatar zneuron commented on August 26, 2024

the result of md5(12345) and md5('12345') should be same, i don't understand why not now; if the message is not strings or buffers, it should be converted to string at first, and then return the md5 value

from node-md5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.