I'm trying to replicate Java UUID.nameUUIDFromBytes method in Postgres.
I've created uuid-ossp extension
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
In Java I call
UUID.nameUUIDFromBytes((NAMESPACE + someString).getBytes())
Both NAMESPACE and someString are of type String. But uuid_generate_v3 accepts (uuid, varchar). Passing uuid_generate_v3(uuid(NAMESPACE), someString) generates different from java UUID method result. Wondering if it is possible to get the same output without rewriting the whole logic explicitly as there is a solution described by Győző Papp in a similar question where the reverse result was desired though. Although it works correctly, it's quite verbose and tightly coupled with Java lib. Would be grateful if anyone could advise some more stable and reliable solution.
Thank you!