def get_image_unique_id(self, image_href):
"""Get unique ID of the resource.
If possible, the ID should change if resource contents are changed.
:param image_href: Image reference.
:returns: Unique ID of the resource.
"""
# NOTE(vdrok): Doing conversion of href in case it's unicode
# string, UUID cannot be generated for unicode strings on python 2.
return str(uuid.uuid5(uuid.NAMESPACE_URL,
image_href.encode('utf-8')))
评论列表
文章目录