reddit-image-wall-getter/reddit_imgs/system/hexhashof.py

11 lines
247 B
Python

#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
from hashlib import _DataType
from hashlib import _Hash
from typing import Type
def hexhashof(bts: _DataType, using: Type[_Hash]) -> str:
m = using()
m.update(bts)
return m.hexdigest()