lib/stringex/string_extensions.rb
# Returns string of random characters with a length matching the specified limit. Excludes 0
# to avoid confusion between 0 and O.
Returns string of random characters with a length matching the specified limit. Excludes 0
to avoid confusion between 0 and O.
Returns string of random characters with a length matching the specified limit . Excludes 0 to avoid confusion between 0 and O .
def random(limit)
        strong_alphanumerics = %w{
          a b c d e f g h i j k l m n o p q r s t u v w x y z
          A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
          1 2 3 4 5 6 7 8 9
        }
        Array.new(limit, "").collect{strong_alphanumerics[rand(61)]}.join
      end
def random ( limit ) strong_alphanumerics = %w{ a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9 } Array . new ( limit , "" ) . collect { strong_alphanumerics [ rand ( 61 ) ] } . join end
Returns string of random characters with a length matching the specified limit.
Returns string of random characters with a length matching the specified limit .
limit