Kodax

التحقق من سلامة الملفات بالهاش — تحدي Python

اكتب verify_integrity(content, expected_hex) تحسب SHA-256 للنص (UTF-8) وتقارنه بالقيمة المتوقعة مقارنة آمنة زمنياً (hmac.compare_digest)، وتُرجع True/False.

import hashlib
import hmac


def verify_integrity(content, expected_hex):
    pass
ابدأ الحل