AndreiBogdan AndreiBogdan - 7 months ago 11
Javascript Question

Javascript. Convert MD5 hash into an integer

Is it possible in Javascript to convert something like this:

d131dd02c5e6eec4 693d9a0698aff95c 2fcab58712467eab 4004583eb8fb7f89
, which is the result of an MD5 hash function, into an integer ?

Answer

That looks like a hexadecimal number, so you could try using the parseInt function and pass in a base of sixteen:

var num = parseInt(string, 16);

Edit: This method doesn't actually work. See the comments for details.