avoid copying entire payload just to calc md5
Merge pull request #600 from SamSaffron/master

avoid copying entire payload twice just to hash it