move require 'digest' to where it is actually used