Skip to content

Instantly share code, notes, and snippets.

@neoPix
Last active May 11, 2022 19:43
Embed
What would you like to do?
Stamp generation
const date = '1614538506419'
const xorKey = Buffer.from('RFtoRq/vDXJmRndoZaZQyfOot7OrIqGVFj96iY2WL3yyH5Z/pUvlUhqmCxD2t+D6B+A=', 'base64');
const rawData = Buffer.from(`014d2225-8495-4735-812d-2616334fd15d:${date}`, 'utf-8');
const xorBuffers = (a, b) => {
if(a.length !== b.length) {
throw new Error('Buffer are not the same size');
}
const outBuffer = Buffer.alloc(a.length);
for(let i = 0; i< outBuffer.length; i++) {
outBuffer.writeUInt8(a[i] ^ b[i], i);
}
return outBuffer;
}
console.log(xorBuffers(xorKey, rawData).toString('base64'));
const date = '1614538506419'
const xorKey = Buffer.from('wLTVxwidmH8CfJYBWSnHD85blPya6TjKbuHgL2FCr+Kh8gx+uckCyT5W7h4Ngbn3IuY=', 'base64');
const rawData = Buffer.from(`e7bcd186-a5fd-410d-92cb-6876a42288bd:${date}`, 'utf-8');
const xorBuffers = (a, b) => {
if(a.length !== b.length) {
throw new Error('Buffer are not the same size');
}
const outBuffer = Buffer.alloc(a.length);
for(let i = 0; i< outBuffer.length; i++) {
outBuffer.writeUInt8(a[i] ^ b[i], i);
}
return outBuffer;
}
console.log(xorBuffers(xorKey, rawData).toString('base64'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment