nginx uid decoding using Base64.decode64

Maxim Dounin mdounin at
Fri Sep 9 18:11:09 UTC 2011


On Fri, Sep 09, 2011 at 07:35:20PM +0200, dhaval d. wrote:

> Hi,
>     I was facing a problem while decoding a nginx generated uid using
> ruby.
> The uid which I get from nginx cookie is "CqCx7E5qMNUxrmAUAwMJAg==" and
> when I try to decode this using
>  Base64.decode64("CqCx7E5qMNUxrmAUAwMJAg==") ,  it gives me
>  "\n\xA0\xB1\xECNj0\xD51\xAE`\x14\x03\x03\t\x02" instead of
> "ECB1A00AD5306A4E1460AE3102090303" which I see in my access
> logs($uid_got value).
> can any one give some suggestions on this issue?

Logged value is a hex representation of the data, using 4 host-order 
uint32_t values.  I.e. "\n\xA0\xB1\xEC" matches "ECB1A00A" and so on.

Maxim Dounin

More information about the nginx mailing list