Skip to content

Uncaught SyntaxError: Unexpected token # in JSON at position 0 #16

@Pranavprana

Description

@Pranavprana

function decryptLicense(encryptedLicense, description, serial) {
const hDesc = crypto.createHash('md5').update(description, 'ascii').digest('hex');
const hSerial = crypto.createHash('md5').update(serial, 'ascii').digest('hex');

const textEncoder = new TextEncoder();
const xorKey = textEncoder.encode(hDesc.substring(0, 16));
const xorData = [
    textEncoder.encode(hDesc.substring(16, 32)),
    textEncoder.encode(hSerial.substring(0, 16)),
    textEncoder.encode(hSerial.substring(16, 32)),
];
const decryptionKey = Uint8Array.from(xorBytes(xorKey, xorData, 16));
const buf = stripPadding(createDecipher(decryptionKey).update(encryptedLicense, 'hex')).toString();
return JSON.parse(buf);

}
having with parse
Uncaught SyntaxError: Unexpected token # in JSON at position 0
JSON.parse(buf);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions