Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #######################################################
- ##** Text to Int Encoder
- ##** Text to Int Decode Helper
- ##** Copyright by Narzew
- ##** http://pokepark.tk
- ##** 29.11.12
- #######################################################
- #######################################################
- ##**encode_ints
- ##**Encodes string to int (one-way!)
- #######################################################
- def encode_ints(x)
- return x.downcase.tr('abcdefghijklmnopqrstuvwxyz','22233344455566677778889999')
- end
- #######################################################
- ##**decode_ints
- ##**Helps decoding ints making possibilities to each int
- #######################################################
- def decode_ints(x)
- return x.gsub('2','(abc)').gsub('3','(def)').gsub('4','(ghi)').gsub('5','(jkl)').gsub('6','(mno)').gsub('7', '(pqrs)').gsub('8', '(tuv)').gsub('9', '(wxyz)')
- end
- #######################################################
- ##**End of script
- #######################################################
- #######################################################
- ##**Copyright by Narzew
- ##**http://pokepark.tk
- #######################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement