Skip to content

Instantly share code, notes, and snippets.

@jamster
Created April 25, 2011 16:36
Show Gist options
  • Select an option

  • Save jamster/940768 to your computer and use it in GitHub Desktop.

Select an option

Save jamster/940768 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'base64'
require 'open-uri'
string = "hardware_version=google&app_version=1.0.0&api_key=asdf1234&device_id=1234&os_version=2.0&user_code=988748513"
encoded = Base64.encode64(string).gsub(/\n/,'')
puts encoded
puts Base64.decode64(encoded)
puts Base64.decode64("aGFyZHdhcmVfdmVyc2lvbj1nb29nbGUmYXBwX3ZlcnNpb249MS4wLjAmYXBpX2tleT1hc2RmMTIzNCZkZXZpY2VfaWQ9MTIzNCZvc192ZXJzaW9uPTIuMCZ1c2VyX2NvZGU9OTg4NzQ4NTEz")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment