Skip to content

Instantly share code, notes, and snippets.

@flazz
Created December 9, 2010 22:46
Show Gist options
  • Select an option

  • Save flazz/735456 to your computer and use it in GitHub Desktop.

Select an option

Save flazz/735456 to your computer and use it in GitHub Desktop.
fixes sha1#update bug on OSX
require 'digest/sha1'
# this patch fixes SHA1#update on OSX
class Digest::SHA1
def update s
buf_size = 1024 ** 2
if s.size > buf_size
io = StringIO.new s
buf = String.new
super buf while io.read(buf_size, buf)
else
super s
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment