Updated to fallback to SHA1 if SHA256 is unavailable