like we get alphanumeric characters we get to reset the password ?
Discussion posts and replies are publicly visible
a!localVariables( local!array: { 33 + tointeger(rand(5) * (47 - 33)), /* For special chars*/ 48 + tointeger(rand(8) * (57 - 48)), /* For integer*/ 65 + tointeger(rand(10) * (90 - 65)) /* For alphabets*/ }, local!oldIndex: enumerate(length(local!array)) + 1, local!newIndex: union( 1 + tointeger( rand(length(local!array)) * (length(local!array) - 1) ), tointeger({}) ), local!diffindex: difference(local!oldIndex, local!newIndex), local!finalIndex: append(local!newIndex, local!diffindex), joinarray( a!forEach( items: local!finalIndex, expression: char(index(local!array, fv!item, {})) ), "" ) )
Here, 5, 8, and 10 represent the length of the characters written next to them!
Thank you @AyushAgrawal
concat( char( a!forEach( items: enumerate(10), expression: if( contains({ 1, 4, 7, 10 }, fv!index), 34 + tointeger(rand() * (47 - 33)), contains({ 2, 5, 8 }, fv!index), 48 + tointeger(rand() * (57 - 48)), 68 + tointeger(rand() * (90 - 65)) ) ) ) )
You can also use this for generate random string with special characters, numbers, and alphabets for password.