node-steam-appticket icon indicating copy to clipboard operation
node-steam-appticket copied to clipboard

How to convert a ticket from a string to hexadecimal

Open hubing123 opened this issue 3 years ago • 3 comments

hubing123 avatar Feb 19 '22 11:02 hubing123

I assume by "string" you mean a binary string?

let binaryString = getBinaryStringSomehow();
let buffer = Buffer.from(binaryString, 'binary');
let hexadecimal = buffer.toString('hex');

Buffer docs

DoctorMcKay avatar Feb 21 '22 05:02 DoctorMcKay

let binaryString = "261551"; let buffer = Buffer.from(binaryString, 'binary'); let ticket = buffer.toString('hex'); const decryptionKey = '16a71c423df683e98af58e40c60a6fc8087dc360f977a73c7d138e8d26b99062'; console.log(AppTicket.parseEncryptedAppTicket(ticket, decryptionKey));

the output is null, but the ticket and decryptionKey is right, could you help me?

hubing123 avatar Mar 05 '22 07:03 hubing123

"261551" doesn't look like a binary string.

DoctorMcKay avatar Mar 05 '22 11:03 DoctorMcKay