Anonymous user
Password generator: Difference between revisions
→{{header|Raku}}
Line 3,066:
9%-tYX]z?8-xA5</pre>
=={{header|Raku (functional) }}==
This has the pretty much the same interface as above, except the "count" parameter is mandatory.
The idea here is to have an infinite sequence of random password characters and
batch them up in groups of the wanted length. This solution relies heavily on Rakus lazy lists.
<lang perl6>
Line 3,105:
sub password-characters( @char-groups )
{
.map( |* )
.map( *.pick );
}
Line 3,117 ⟶ 3,119:
}
</lang>
'''Sample output:'''
Using defaults:
<pre>Jk&>Az22</pre>
With passed parameters: --l=4 --c=5 --x=0O\'\"1l\|I
<pre>
+6cH
w,A9
A{2k
5_Vy
X_2k</pre>
=={{header|REXX}}==
|