Guest User

Untitled

a guest
May 21st, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. SIXTYTWO = ('0'..'9').to_a + ('a'..'z').to_a + ('A'..'Z').to_a
  2.  
  3. def to_s_62(i)
  4. return '0' if i == 0
  5. s = ''
  6. while i > 0
  7. s << SIXTYTWO[i.modulo(62)]
  8. i /= 62
  9. end
  10. s.reverse
  11. end
Add Comment
Please, Sign In to add comment