mirror of
https://github.com/jwetzell/psn-js.git
synced 2026-08-20 06:29:12 +00:00
ENCODING!! and lots of organization
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
const chunk = require('../chunk');
|
||||
|
||||
module.exports = (timestamp) => {
|
||||
const buf = Buffer.alloc(8);
|
||||
const timestampHigh = timestamp.toString(2).padStart(64, '0').substring(0, 32);
|
||||
const timestampLow = timestamp.toString(2).padStart(64, '0').substring(32);
|
||||
buf.writeUInt32LE(parseInt(timestampLow, 2));
|
||||
buf.writeUInt32LE(parseInt(timestampHigh, 2), 4);
|
||||
return chunk(0x0006, buf, false);
|
||||
};
|
||||
Reference in New Issue
Block a user