cancel
Showing results for 
Search instead for 
Did you mean: 

Random 16 Byte nonce

Richard
New Contributor III

Hi,

Can somebody tell me how I can generate a random 16-byte nonce in the 32-character hexadecimal format.
I like to do this in the mapper, is that possible?

Thanks for your help.

5 REPLIES 5

alchemiz
Contributor III

Hi Richard,

Here’s a sample pipeline that outputs a binary string base from a hexadecimal string hope this helps 🙂

image

canvas 05_2022_02_28.slp (8.8 KB)

Richard
New Contributor III

Hi Alchemiz

Thanks for the solution.

How do I make it an 32 character hexadecimal value instead of 40, the length must be 32?

Thanks

You can use Digest.md5(Math.randomUUID()) instead of sha1

image

You can also use Math.randomUUID().replace(/-/gi,‘’)