-
-
Save neoPix/f3add84177afc615afd924059a0ff407 to your computer and use it in GitHub Desktop.
Stamp generation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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