move require 'digest' to where it is actually used
Merge pull request #5591 from rolandwalker/move_digest_require

move require 'digest' to where it is actually used