I am truly struggling to convert a Buffer to a string.
For this code
let results = await generateRandomNumber(seed);
console.log(results);
res.status(200).json({
"status": 200,
"number": results
});
}
I receive for the console.log(results);
{
result: <Buffer ee 62 e7 6f c7 4b 7f 57 86 20 bd ba 52 74 4a fc 66 89 70 bb>
}
And the response JSON is:
{"status":200,"number":{"result":{"type":"Buffer","data":[238,98,231,111,199,75,127,87,134,32,189,186,82,116,74,252,102,137,112,187]}}}
All I want to achieve is that the number actually becomes a number and not the Buffer.