Guest User

Untitled

a guest
Jul 16th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. require 'digest/sha1'
  2.  
  3. # this patch fixes SHA1#update on OSX
  4. class Digest::SHA1
  5.  
  6. def update s
  7. buf_size = 1024 ** 2
  8.  
  9. if s.size > buf_size
  10. io = StringIO.new s
  11. buf = String.new
  12. super buf while io.read(buf_size, buf)
  13. else
  14. super s
  15. end
  16.  
  17. end
  18.  
  19. end
Add Comment
Please, Sign In to add comment