def uuid5(namespace, name):
 from hashlib import sha1
 hash = sha1((namespace.bytes + bytes(name, 'utf-8'))).digest()
 return UUID(bytes=hash[:16], version=5)

def uuid5 ( namespace , name ) : from hashlib import sha1 hash = sha1 ( ( namespace . bytes + bytes ( name , 'utf-8' ) ) ) . digest ( ) return UUID ( bytes = hash [ : 16 ] , version = 5 )
generate a uuid from the sha-1 hash of a namespace uuid and a name .