Beispiel #1
0
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))
Beispiel #2
0
def get_file_hash(path):
    return get_bytes_hash(open(path, 'rb').read())
Beispiel #3
0
def get_hash(img, ext):
    return get_bytes_hash(write_bytes(img, ext))