Bugfix
This commit is contained in:
parent
44d740f84e
commit
38ea108183
3 changed files with 3 additions and 3 deletions
src
|
@ -26,7 +26,7 @@ module.exports = {
|
|||
* Create a byte array representing a number with the given length
|
||||
*/
|
||||
numToBytes: function(num,bytes) {
|
||||
if (bytes == 0 || (bytes === null && num === 0)) return [];
|
||||
if (bytes == 0 || (bytes === undefined && num === 0)) return [];
|
||||
else return [num % 256].concat(module.exports.numToBytes(Math.floor(num / 256),bytes-1));
|
||||
},
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue