Merge pull request #20 from jgarzik/unsigned-fix

Deserialize: fix unsigned bitwise math
This commit is contained in:
Stephen Pair 2013-08-02 17:47:23 -07:00
commit cff61a6683
1 changed files with 2 additions and 2 deletions

View File

@ -1,8 +1,8 @@
exports.intFromCompact = function(c)
{
var bytes = (c >> 24) & 0xff;
var v = (c & 0xffffff) << (8 * (bytes - 3));
var bytes = ((c >>> 24) & 0xff) >>> 0;
var v = ((c & 0xffffff) << (8 * (bytes - 3))) >>> 0;
return v;
}