Changes since previous version: + fix a bug where SHA512 case was missed in the digest_get_prefix() function. Bug and fix from Felix Lange.