-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
Lines 10 to 19 in bbdf82a
| function intToBytes(num) { | |
| var bytes = []; | |
| for(var i=7 ; i>=0 ; --i) { | |
| bytes[i] = num & (255); | |
| num = num >> 8; | |
| } | |
| return bytes; | |
| } |
intToBytes(9999999999999) will give [0, 0, 0, 0, 78, 114, 159, 255] which is <Buffer 00 00 00 00 4e 72 9f ff>
But 9999999999999 decimal to hexadecimal must return 00 00 09 18 4E 72 9F FF
Metadata
Metadata
Assignees
Labels
No labels