Forum Discussion

Richard's avatar
Richard
New Contributor III
4 years ago

Random 16 Byte nonce

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

  • Richard's avatar
    Richard
    New Contributor III

    I like to thank everybody for their help in this matter.

    • Richard's avatar
      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

      • alchemiz's avatar
        alchemiz
        Contributor III

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