Created
September 1, 2010 20:06
-
-
Save cvonkleist/561259 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sum_to_pw(int) | |
out = "%u" % ((int * 31695317) & 0xffffffff) | |
out.bytes.each_with_index do |b, i| | |
out[i] += '!'[0] if out[i] < '3'[0] | |
out[i] += '/'[0] if out[i] < '7'[0] | |
out[i] += 'B'[0] if out[i] < '9'[0] | |
end | |
out | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment