Hacemos una verificación profunda cada artículo de nuestro espacio con la meta de enseñarte siempre la información más veraz y actual.
Ejemplo 1: función hash de Python
# Hash Function # SHA hash algorithms. import hashlib
# initializing string str="TYCS"# encoding TYCS using encode() # then sending to SHA1()
result = hashlib.sha1(str.encode())# printing the equivalent hexadecimal value. print("The hexadecimal equivalent of SHA1 is : ")print(result.hexdigest())# encoding TYCS using encode() # then sending to SHA224()
result = hashlib.sha224(str.encode())# printing the equivalent hexadecimal value. print("The hexadecimal equivalent of SHA224 is : ")print(result.hexdigest())# encoding TYCS using encode() # then sending to SHA256()
result = hashlib.sha256(str.encode())# printing the equivalent hexadecimal value. print("The hexadecimal equivalent of SHA256 is : ")print(result.hexdigest())# initializing string str="TYCS"# encoding TYCS using encode() # then sending to SHA384()
result = hashlib.sha384(str.encode())# printing the equivalent hexadecimal value. print("The hexadecimal equivalent of SHA384 is : ")print(result.hexdigest())# initializing string str="TYCS"# initializing string str="TYCS"# encoding TYCS using encode() # then sending to SHA512()
result = hashlib.sha512(str.encode())# printing the equivalent hexadecimal value. print("The hexadecimal equivalent of SHA512 is : ")print(result.hexdigest())
Ejemplo 2: hash de Python
from hashlib import blake2b
import time
k =str(time.time()).encode('utf-8')
h = blake2b(key=k, digest_size=16)
h.hexdigest()
Ejemplo 3: Hash en Python
Hashing implementation at this link:
https://github.com/shreyasvedpathak/Data-Structure-Python/tree/master/Hashing
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)