Open mainak0907 opened 11 months ago
Hey Mainak,
As shown in the error, the issue is that the message must be shorter than 262144 bytes, to solve this, split your message into sections split by 262144. Here's how you would do it in TypeScript
function splitStringByBytes(str: string, byteSize: number): string[] {
const buffer = Buffer.from(str, 'utf-8');
let start = 0;
const result = [];
while (start < buffer.length) {
let end = start + byteSize;
if (end > buffer.length) {
end = buffer.length;
}
result.push(buffer.slice(start, end).toString('utf-8'));
start = end;
}
return result;
}
const chunks = splitStringByBytes('The Resume Message', 262144);
Kind Regards, WillKirkmanM
Greetings @nevo-david , I was implementing the Resume maker with ChatGPT and encountered this error.