If you want to quickly change 25 to hexadecimal in ruby you only need to pass 16 as argument in to_s method:

25.to_s(16)

You can use it for making simple password generator:

rand(999_999_999).to_s(32)

Comments