Forum Discussion

Oliver_Schmidt's avatar
Oliver_Schmidt
Icon for Nimbostratus rankNimbostratus
Feb 14, 2006

base64 decoding

Hi,

 

I want to base64 decode a 24 character string to a 32 Hex string.

 

b64decode transfoms the string to a 16 Byte long string

 

To convert it to the 32 Hex values I use the TCL command

 

binary scan $v2 H* v3

 

Example:

 

set v1 6LCnVil6ib5Df9+6JFiW5A==

 

set v2 [b64decode $v1]

 

binary scan $v2 H* v3

 

log $v3

 

 

v3 has the value

 

2756297a89be437ffa245896e4

 

it should have:

 

e8b0a756297a89be437fdfba245896e4

 

binary scan does not work correct.

 

For some values it works.

 

Is there another way to do the conversion?

 

 

regards,

 

Oliver

1 Reply

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    You might also take a look at the binary format command, which works much the same way.

     

     

    Other than that, though, I'm not aware of another way to make this transformation. Perhaps someone else here is?

     

     

    -Colin