1
0
Fork 0
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:
geemus 2010-05-13 14:30:57 -07:00
parent 51b8e4df58
commit a5161bd8bd

View file

@ -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)