mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws] optimize mock number/hex generation
This commit is contained in:
parent
51b8e4df58
commit
a5161bd8bd
1 changed files with 4 additions and 8 deletions
|
@ -164,17 +164,13 @@ module Fog
|
|||
end
|
||||
|
||||
def self.numbers(length)
|
||||
random_selection(
|
||||
'0123456789',
|
||||
length
|
||||
)
|
||||
max = ('9' * length).to_i
|
||||
rand(max).to_s
|
||||
end
|
||||
|
||||
def self.hex(length)
|
||||
random_selection(
|
||||
'0123456789abcdef',
|
||||
length
|
||||
)
|
||||
max = ('f' * length).to_i(16)
|
||||
rand(max).to_s(16)
|
||||
end
|
||||
|
||||
def self.base64(length)
|
||||
|
|
Loading…
Reference in a new issue