Skip to content

Instantly share code, notes, and snippets.

@cvonkleist
Created September 1, 2010 20:07
Show Gist options
  • Save cvonkleist/561263 to your computer and use it in GitHub Desktop.
Save cvonkleist/561263 to your computer and use it in GitHub Desktop.
def vxworks_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