import hashlib
# 创建md5对象
obj = hashlib.md5()
# 把要加密的信息传递给obj
obj.update("6666".encode('utf-8'))
# 从obj中拿到密文
mi = obj.hexdigest()
print(mi) # e9510081ac30ffa83f10b68cde1cac07
# 正常的默认加密过程是容易撞库的
# 解决办法:加盐
obj = hashlib.md5(b'jfkaldsjflkjas')
obj.update("6666".encode('utf-8'))
print(obj.hexdigest()) #6e250629dd5f7ba70053bd3799e55b26
str1 = "21312313fa\nd123123123124fasd"
# with open('1.txt',mode='w',encoding='utf-8') as f:
# f.write(str1)
with open('1.txt',mode='r',encoding='utf-8') as f:
print(f.readline())
# print(f.readline().strip())