0
$\begingroup$

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)?

$\endgroup$
3
  • $\begingroup$ 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? $\endgroup$
    – bmm6o
    Jul 27 at 16:36
  • $\begingroup$ @bmm6o I got the notion that a hash function was involved from this question here: crypto.stackexchange.com/questions/83278/… 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. $\endgroup$
    – Rikudou
    Jul 27 at 17:18
  • $\begingroup$ If your question is ultimately "how was this string produced", that's not really something that we can answer. $\endgroup$
    – bmm6o
    Jul 28 at 0:21
1
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.