Merhaba.
Bunun için hash
algoritmaları kullanılır.
Anti-Virüs.py:
from hashlib import sha256
DB = \
[
"18885f27b5af9012df19e496460f9294d5ab76128824c6f993787004f6d9a7db" # Python
]
def scan(file):
with open(file, "rb") as f:
if sha256(f.read()).hexdigest() in DB:
return True
else:
return False
print(scan("Program.txt"))
print(scan("Virüs.txt"))
Program.txt:
python
Virüs.txt:
Python