1.error message: TypeError: Unicode-objects must be encoded before hashing
2.error message: TypeError: object supporting the buffer API required
The correct way to write it should be
codes:
import hashlib
def md5pwd(password):
m = hashlib.md5()
m.update(password)
mpwd = m.hexdigest()
return mpwd
print(md5pwd(b’123456′))
Similar Posts:
- [Solved] Django Run Error: TypeError: object supporting the buffer API required
- Error reporting and resolution of Python 3 using binascii method
- UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-1:
- joi Validation error: UnhandledPromiseRejectionWarning: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
- [Solved] Python TypeError: expected a string or other character buffer object
- [Solved] HTTP receives the return value using tencoding Utf8 encoding error “no mapping for the Unicode…”
- TypeError: save() missing 1 required positional argument: ‘self’
- Solve the problem of “typeerror: ‘bool’ object is not callable” in flash and Django
- How to Solve Django xadmin installation Error [7 Types of Errors]
- Django: How to Convert Models object to JSON