Skip to content

Commit

Permalink
Merge pull request #5 from nokk/master
Browse files Browse the repository at this point in the history
replaced bignum with long
  • Loading branch information
cainus committed May 20, 2014
2 parents 2d5ea25 + ad3b40b commit f1bd25b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/BufferMaker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var bignum = require('bignum');
var Long = require('long');


var BufferMaker = function(){
this.plan = [];
Expand Down Expand Up @@ -57,10 +58,9 @@ BufferMaker.prototype.make = function(){
item = this.plan[i];
switch(item.type){
case "Int64BE":
var signed64BitBuffer = bignum(item.value).toBuffer({endian : "big", size : 8});
for(j = 0; j < signed64BitBuffer.length; j++){
buffer[offset + j] = signed64BitBuffer[j];
}
var longVal = Long.fromString(item.value + "");
buffer.writeUInt32BE(longVal.getHighBits(), offset); //write the high order bits (shifted over)
buffer.writeUInt32BE(longVal.getLowBits(), offset + 4); //write the low order bits
offset += 8;
break;
case "string":
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
],
"dependencies": {
"bignum" : "0.6.2"
"long" : "latest"

This comment has been minimized.

Copy link
@Raynos

Raynos Sep 5, 2014

dont ever do this ;_____;

},
"devDependencies" : {
"jscoverage" : "0.3.6",
Expand Down

2 comments on commit f1bd25b

@cainus
Copy link
Owner Author

@cainus cainus commented on f1bd25b Sep 6, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I fixed that about 4 minutes after merging that PR. I actually don't use any fuzzy versions at all in my packages.

@Raynos
Copy link

@Raynos Raynos commented on f1bd25b Sep 6, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cainus cool :) awesome.

Please sign in to comment.