| lib/Rex/Helper/Misc.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % | 
| statement | 11 | 11 | 100.0 | 
| branch | n/a | ||
| condition | n/a | ||
| subroutine | 3 | 3 | 100.0 | 
| pod | 0 | 1 | 0.0 | 
| total | 14 | 15 | 93.3 | 
| line | stmt | bran | cond | sub | pod | time | code | 
|---|---|---|---|---|---|---|---|
| 1 | # | ||||||
| 2 |  # (c) Jan Gehring  | 
||||||
| 3 | # | ||||||
| 4 | |||||||
| 5 | package Rex::Helper::Misc; | ||||||
| 6 | |||||||
| 7 | 102 | 102 | 1357 | use v5.12.5; | |||
| 102 | 343 | ||||||
| 8 | 102 | 102 | 558 | use warnings; | |||
| 102 | 186 | ||||||
| 102 | 11745 | ||||||
| 9 | |||||||
| 10 | our $VERSION = '1.14.3'; # VERSION | ||||||
| 11 | |||||||
| 12 | sub get_random { | ||||||
| 13 | 916 | 916 | 0 | 3846 | my $count = shift; | ||
| 14 | 916 | 8030 | my @chars = @_; | ||||
| 15 | |||||||
| 16 | 916 | 2545 | my $ret = ""; | ||||
| 17 | 916 | 3303 | for ( 1 .. $count ) { | ||||
| 18 | 10985 | 21184 | $ret .= $chars[ int( rand( scalar(@chars) - 1 ) ) ]; | ||||
| 19 | } | ||||||
| 20 | |||||||
| 21 | 916 | 10946 | return $ret; | ||||
| 22 | } | ||||||
| 23 | |||||||
| 24 | 1; |