views:

92

answers:

1

What kind of hashing algorithm used to generate 12 character length alphanumeric?

for example stackoverflow use 2 keys to store cookies

t=IhweorwSw6K7
s=............  (#intentionally replace with . because its a session cookies)

How does that hashing algorithm looks like?

+1  A: 

"Each is a base64-encoded 128-bit (presumably random) number, with the trailing == removed."

From: http://meta.stackoverflow.com/questions/12047/what-are-the-s-and-t-parameters-in-the-user-cookie-used-by-stackoverflow

Maybe.

zaf
+1, Thank you, I thought It was known algorithm somewhere out there. but this also make sense. may be it is.
S.Mark
A base64 encoded 128 bit number would be 22 bytes, 24 with ==.
drawnonward
@drawnonward, yeah you're right, and why its supposed to be 128-bit btw @zaf?
S.Mark
If I changed to 72bits (9bytes), I got 12 bytes in base64 btw. is there any algorithms like that?
S.Mark
@S.Mark I don't know the details. Sorry. I would just use random input that when base64'd comes out 12 chars. Minus the '==' of course.
zaf
@zaf, no problem, looks like stackoverflow rolling their own way to generate that anyway.
S.Mark