implement compare_digest() fallback since 2.7.7 isn't available yet