One-way hash -> you need to store the result to look up based on it -> likely better off using random identifier, and not worry about hash weakness etc.
Random Identifiers -> UUIDs are (mostly) randomness, especially the v4 one. V7 leaks the time component, so you can hash that part (and randomize it again), of course in that case you'd need to have an explicit mapping and then lookup, but once you get to the internal identity you dont have to worry either.