uuid v5 in Postgres
Asked Answered
F

1

8

Does Postgres (or a Postgres extension) have a uuid v5 function (ie one that takes in a UUID name space and a string to produce a new UUID)?

If not a native function, how would one write this function?

Flask answered 26/9, 2018 at 21:42 Comment(1)
How is UUID v5 defined?Sower
B
8

Yes, uuid-ossp module provides such function.

uuid_generate_v5(namespace uuid, name text)

This function generates a version 5 UUID, which works like a version 3 UUID except that SHA-1 is used as a hashing method. Version 5 should be preferred over version 3 because SHA-1 is thought to be more secure than MD5.

Billionaire answered 27/9, 2018 at 9:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.