using nodejs I am trying to generate an unique URL for user to conform email address. From that URL user will be able to verify th
IMHO, for @JaiKumarRajput's answer,
He encoded the string with,
ciphertext.toString().replace('+','xMl3Jk').replace('/','Por21Ld').replace('=','Ml32');
Now, I have no idea how xMl3Jk, Por21Ld, Ml32 works. So, i also don't know if it can mess my string somehow.
Plus, As I have to perform this on decoding as well. So, Why wont I use something like this (What already exists),
encodeURIComponent(ciphertext.toString('base64'))
I know it still introduces % char. But as its getting used in URL. In which its a escape char.
How does it matter more than doing something that can mess my code up ??
NOTE: I used it and had no issue, It doesn't mean I either had found any issue with the top one. That didn't feel neat. Its only my humble opinion, So if u don't like it? Ignore it.