Is there a way to take a URN like urn:epc:id:sscc:0614141.1234567890 and convert this to a deterministic UUID that produces the same UUID every time I convert it.
I have a client where this would be a really extremely helpful feature as they are trying to figure out all the ways their disparate data systems connect. And could always default into proper generated UUID at a later date.
Just as sample code - here is something I coded up in PySpark to do something in a different arena. I wonder if like this function - seeding a function would be key.
def deterministic_uuid(seed:str): m = hashlib.md5() m.update(seed.encode('utf-8')) new_uuid = uuid.UUID(m.hexdigest()) return str(new_uuid) # line below makes this function available in PySpark/Spark uuid_udf = F.udf(lambda x: deterministic_uuid(x), StringType())