avoids possible digest collision issues

Hi, this fixes some issues I was having with digest collisions.  Merge at your own risk since there are no unit tests.  If you would write some basic unit tests I would definitely add to them.

thanks
Chris