Skip to content

Instantly share code, notes, and snippets.

@neoPix
Last active May 11, 2022 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neoPix/f3add84177afc615afd924059a0ff407 to your computer and use it in GitHub Desktop.
Save neoPix/f3add84177afc615afd924059a0ff407 to your computer and use it in GitHub Desktop.
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