mirror of
https://github.com/jwetzell/psn-js.git
synced 2026-08-14 20:03:57 +00:00
11 lines
400 B
JavaScript
11 lines
400 B
JavaScript
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);
|
|
};
|