Skip to content

Instantly share code, notes, and snippets.

/a.rb Secret

Created November 5, 2012 13:22
Show Gist options
  • Save anonymous/d3918a0391cd869e3d3b to your computer and use it in GitHub Desktop.
Save anonymous/d3918a0391cd869e3d3b to your computer and use it in GitHub Desktop.
require 'digest/sha1'
filedata_hash = ["f5121cfb38da06e0c99dfe8fe2ed72655f5572a0"].pack('H*')
filename_hint = "test.java".ljust(256, "\x00")
# 283e4f1a02cb7e161acdc24196ac429f0687c4ef
puts Digest::SHA1.hexdigest(filedata_hash + filename_hint)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment