on ‎2013 Mar 12 11:49 PM
Hi all,
I need to convert a HEX to string for X509 certificate serial number. Anyone have a simple function for this.
Right now I'm using MS SQL Server to do the conversion but would love to do it client side.
SELECT CONVERT(VARCHAR(MAX), CONVERT(VARBINARY(MAX), '0x3030303031303030303030323031303633393638', 1))
I'm using PB 12.5.1
Regards,
Adrian
Request clarification before answering.
I'm sorry, Adrian, I'm not clear what data type variable you have that in, in PB. One would need that information to offer an answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dan,
I'm sorry. I'm calling an API that is returning a string with a HEX value. I need to convert that string with the HEX value to regular ascii string.
As I mention my first post I'm using a varchar on SQL Server to convert the varchar by only putting in front 0x so that SQL Server takes it as a HEX value.
If I use the following syntax PB will give me an error.
ls_hex = "~h"+ls_string
Regards,
Adrian
OK, Adrian, I'm still confused I'm afraid. A hex string is a string, and it is certainly ASCII. So what do you really mean? Do you mean convert a hex number (of how many digits?) to a long (perhaps very long?) integer, and then represent that as a string?
Perhaps you could give a simple specific example of what should be converted to what.
If others are clearer on this than I am, do jump in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.