def get_hash(img, ext): ''' The function get_hash hash input image with sha256 algoritm and encode result by using Base64 :param img: image in RGB format(numpy matrix) :param ext: file extension that defines the output format :return: the byte object ''' return get_bytes_hash(write_bytes(img, ext))
def get_file_hash(path): return get_bytes_hash(open(path, 'rb').read())
def get_hash(img, ext): return get_bytes_hash(write_bytes(img, ext))