Score:0

Is it possible to have a hash in UUID form that ends with 16 characters instead of 12?

uz flag

You may know how sometimes a hash in a URL may be in UUID format, which consists of groups of hex values separated by hyphens. In UUID format, I have come to learn that this hash takes the form:

8-4-4-4-12 for a total of 32 characters. However, I came across a URL that had a hash for a request parameter that looked like this:

9ced2fb4-f1df-4f00-af76-940736bfeee0001f

Notice that this format is 8-4-4-4-16.

Now, I was wondering if this is actually a UUID format or if this is something else entirely. It should be noted that the name of the request parameter was cid, so I don't know if "cid" is an alternative to UUID or something like that.

Also, regardless of whether it is UUID or not, how do you convert this type of hash into a normal hash with no hyphens (by that, I mean to say that I want to convert it to the output that you would get from simply using a hashing algorithm like MD5 or SHA-1 or something like that)?

ph flag
There's no reason to think that hash functions are involved here at all. If something looks like a UUID, it probably is. Are you asking how to remove hyphens from a string?
Rikudou avatar
uz flag
@bmm6o I got the notion that a hash function was involved from this question here: https://crypto.stackexchange.com/questions/83278/does-it-make-sense-that-a-hash-is-separated-by-hyphens This would seem to imply that a UUID comes from doing something to a hash. However, even in the above link and the wiki that it directs to, it's implied that a UUID takes form 8-4-4-4-12. Meanwhile, the string in my post is 8-4-4-4-16. That is another point of contention for me.
ph flag
If your question is ultimately "how was this string produced", that's not really something that we can answer.
Score:1
ph flag

UUIDs are pretty well standardized in industry as a 16-byte entity with a 8-4-4-4-12 hex representation. There are several ways to generate a UUID, and some of them involve hashing, but simply taking 16 bytes from the output of a hash function and calling it a UUID is not compliant.

Obviously any sequence of bytes of length not equal to 16 is not a UUID. It's not unreasonable to take inspiration from the standard UUID hex representation for an arbitrary array of bytes. The UUID format has the advantage of using a small set of characters and has visual separators to reduce transcription errors.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.