I need to hash a string using sha-1 and then base64 encode the result. This is required to interoperate with another agency who's using java to do the same.

We're hashing correctly and getting a hexadecimal string back (need hex since may contain non-ascii characters). However, we can't feed the hash result in to the tobase64 function because it interprets the hexadecimal string as an ascii string. This means the 160 bit hash/40 length hexadecimal string is interpreted by the tobase64 function to be a 320 bit string. The encoding therefore doesn't result in a string 28 characters long (as it should be), but 56.

Is there a CF tag that can properly base64 encode a hexadecimal string? Our other alternative is to use java, which we can do, but I wanted to see if there was a CF way first.

Thanks,
Bob
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to