Monday, January 27, 2014

How to generate the random string or random password using Apex

How to generate the random string or random password using Apex

Integer len = 10;
Blob blobKey = crypto.generateAesKey(128);
String key = EncodingUtil.convertToHex(blobKey);
String pwd = key.substring(0,len);


No comments:

Post a Comment