我智商爆棚
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

22 lines
649 B

module.exports = {
readUInt32BE: function readUInt32BE(buf, offset) {
return buf[offset++] * 16777216
+ buf[offset++] * 65536
+ buf[offset++] * 256
+ buf[offset];
},
writeUInt32BE: function writeUInt32BE(buf, value, offset) {
buf[offset++] = (value >>> 24);
buf[offset++] = (value >>> 16);
buf[offset++] = (value >>> 8);
buf[offset++] = value;
return offset;
},
writeUInt32LE: function writeUInt32LE(buf, value, offset) {
buf[offset++] = value;
buf[offset++] = (value >>> 8);
buf[offset++] = (value >>> 16);
buf[offset++] = (value >>> 24);
return offset;
}
};