base31_guid
This is a small class library, used to display base 10 integers as an easy to read base31 number. This was library was created as part of a bigger project, where a human-readable guid was required.
Requirements for the GUID:
-
The GUID should be easy for a human to read and memorise, if required (ie. no too long and alpha-numeric).
-
The GUID should not randomly generate string that would be considered profanity (hence the exclusion of all vowel characters from the GUID alpha-numeric range).
Sample usage:
#Convert base10 integer to base31 guid string: base10 = 12345 obj = Base31Guid.new(base_length=5) base31 = obj.dec_to_base31($base10num) # base31 = “00DV7”
#Convert base31 guid string to base10 integer base31 = “00DV7” obj = Base31Guid.new(base_length=5) base10 = obj.base31str_to_dec($base31num) # base10 = 12345
Contributing to base31_guid
-
Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet
-
Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it
-
Fork the project
-
Start a feature/bugfix branch
-
Commit and push until you are happy with your contribution
-
Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Copyright
Copyright © 2011 foomip. See LICENSE.txt for further details.