def source_hashed(source_filename, prepared_options, thumbnail_extension,
                  **kwargs):
    source_sha = hashlib.sha1(source_filename.encode('utf-8')).digest()
    source_hash = base64.urlsafe_b64encode(source_sha[:9]).decode('utf-8')
    parts = ':'.join(prepared_options[1:])
    parts_sha = hashlib.sha1(parts.encode('utf-8')).digest()
    options_hash = base64.urlsafe_b64encode(parts_sha[:6]).decode('utf-8')
    return '%s_%s_%s.%s' % (
        source_hash, prepared_options[0], options_hash, thumbnail_extension)
Generate a thumbnail filename of the source filename and options separately
dataset/ETHPy150Open SmileyChris/easy-thumbnails/easy_thumbnails/namers.py/source_hashed