def source_hashed(source_filename, prepared_options, thumbnail_extension, **kwargs):
 source_sha = hashlib.sha1(source_filename.encode(u'utf-8')).digest()
 source_hash = base64.urlsafe_b64encode(source_sha[:9]).decode(u'utf-8')
 parts = u':'.join(prepared_options[1:])
 parts_sha = hashlib.sha1(parts.encode(u'utf-8')).digest()
 options_hash = base64.urlsafe_b64encode(parts_sha[:6]).decode(u'utf-8')
 return (u'%s_%s_%s.%s' % (source_hash, prepared_options[0], options_hash, thumbnail_extension))

def source_hashed ( source_filename , prepared_options , thumbnail_extension , ** kwargs ) : source_sha = hashlib . sha1 ( source_filename . encode ( u'utf-8' ) ) . digest ( ) source_hash = base64 . urlsafe_b64encode ( source_sha [ : 9 ] ) . decode ( u'utf-8' ) parts = u':' . join ( prepared_options [ 1 : ] ) parts_sha = hashlib . sha1 ( parts . encode ( u'utf-8' ) ) . digest ( ) options_hash = base64 . urlsafe_b64encode ( parts_sha [ : 6 ] ) . decode ( u'utf-8' ) return ( u'%s_%s_%s.%s' % ( source_hash , prepared_options [ 0 ] , options_hash , thumbnail_extension ) )
generate a thumbnail filename of the source filename and options separately hashed .