19 20 21 22 23 24 25 26 27 28
# File 'lib/rand62/core_ext.rb', line 19 def base62 return '0' if (i = self) == 0 s = '' while i > 0 s << Rand62::CHARS[i.modulo(62)] i /= 62 end s.reverse! s end