Digest

Shaving off some warts WRT the current implementation of digest in master