forge icon indicating copy to clipboard operation
forge copied to clipboard

encoding for random string to store in db

Open abhijithvijayan opened this issue 5 years ago • 1 comments

What encoding must be used for a string generated using

forge.random.getBytesSync(32)

to be saved to the db?

I have to retrieve it to the same string after fetching it from DB.

abhijithvijayan avatar Jul 13 '19 07:07 abhijithvijayan

I'm learning to use forge too. Have you tried .toHex() and forge.util.hexToBytes(hexstring) ?

viharm avatar Feb 22 '22 18:02 viharm