Skip to content

Instantly share code, notes, and snippets.

@phumberdroz
Created May 21, 2017 16:14
Show Gist options
  • Save phumberdroz/a8caa8a539d06da9d8d31891fef7306f to your computer and use it in GitHub Desktop.
Save phumberdroz/a8caa8a539d06da9d8d31891fef7306f to your computer and use it in GitHub Desktop.
Steam Player ID to Battleye Guid Ruby
require 'digest'
steamid=[]
guid = []
string = 'BE'
steamid << "76561198147354524"
steamid.flatten!
steamid.each { |x|
x = x.to_i
byte_array = string.bytes.to_a
x=x.divmod(256)
byte_array << x[1]
for i in 0..6
x=x[0].divmod(256)
byte_array << x[1]
end
guid.concat [(Digest::MD5.hexdigest byte_array.pack "C*")]
}
puts guid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment