3 ms·
1.to_s(36) #=> "1" 10.to_s(36) #=> "a" 100.to_s(36) #=> "2s" 123456.to_s(36) #=> "2n9c" Ruby. Where the number is the id of the record in the datab
by ashleyw 17y ago
1.to_s(36) #=> "1"
10.to_s(36) #=> "a"
100.to_s(36) #=> "2s"
123456.to_s(36) #=> "2n9c"
Ruby. Where the number is the id of the record in the database or something.
- ashleyw 17y agoAlso forgot to mention, you can do the opposite with: "2n9c".to_i(36) #=> 123456