-1

How to crate this random value

61b97fcbe7351853c5156c2fc18dbf42

ca6e4686bc6889f319331adba74a45e6

i don 't know exactly what is this kid of random but we use it to verify the email address like this

https://www.example.com/registration/confirm?NM=example@gmail.com&SLB=en_CA&KD=ca6e4686bc6889f319331adba74a45e6
enlorans
  • 9
  • 3

2 Answers2

0

Edit :

Don't use this one if you need a safe url random XD

   var a = Math.random();
    console.log(a);
    var b = btoa(a);
    console.log(b)
    // what i just do is base64 the random 
    //or adding a timestamp with random number to make sure it is super random
    var currdate = new Date();
    var c = a+currdate.getTime();
    console.log(btoa(c))

use this instead if you need only low case character and number =>

see here just change the default character

ucup
  • 665
  • 6
  • 17
0

It looks to me like you are looking for a way to create a UUID. If you are looking to create one in javascript I recommend this package.

https://www.npmjs.com/package/uuid

You can use the following code to then generate and store a UUID and use the javascript String prototype's replaceAll function to remove the '-' in the string.

import { v4 as uuidv4 } from 'uuid';
const UUID = uuidv4().replaceAll('-', '');