In case this is useful, if you want to do this part of Java, you can use the following:
UUID namespaceUUID = UUID.fromString("9db60607-6b12-41eb-8848-eafd26681583");
String myString = "sometextinhere";
ByteBuffer buffer = ByteBuffer.wrap(new byte[16 + myString.getBytes().length]);
buffer.putLong(namespaceUUID.getMostSignificantBits());
buffer.putLong(namespaceUUID.getLeastSignificantBits());
buffer.put(myString.getBytes());
byte[] uuidBytes = buffer.array();
UUID myUUID = UUID.nameUUIDFromBytes(uuidBytes);
This will provide the same output UUID as the following Python:
namespaceUUID = UUID('9db60607-6b12-41eb-8848-eafd26681583')
myUUID = uuid.uuid3(myUUID, 'sometextinhere'))
source
share