Skip to content

Incorrect result for ArrayBuffer #49

Description

@rreusser

Hi! Thanks for the great module! It's worked well for me, but I get the incorrect result for ArrayBuffer input, even if I wrap it in a Uint8Array. For example, and comparing to the js-md5 module:

> jsMd5 = require('js-md5')
> md5 = require('md5')

> buffer = new ArrayBuffer(9)
ArrayBuffer { byteLength: 9 }

> x = new Uint8Array(buffer)
Uint8Array [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]

> jsMd5(buffer)
'3f2829b2ffe8434d67f98a2a98968652'
> jsMd5(x)
'3f2829b2ffe8434d67f98a2a98968652'

> md5(buffer)
'441018525208457705bf09a8ee3c1093'
> md5(x)
'f3c8bdb6b9df478f227af2ce61c8a5a1'

Checking the hash of the bytes directly via https://cryptii.com/pipes/md5-hash confirms the js-md5 result :

Screen Shot 2019-03-14 at 10 24 12 AM

See also: #42

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions