1. Praburaj KarthiKeyan
  2. PowerBuilder
  3. Wednesday, 15 December 2021 13:23 PM UTC

 

how to converting string (Hexadecimal) to base64 ? 

Base64Encode () is coverting only TEXT ,Not as Hexadecimal values 

Hexadecimal = "010c426f6273205265636f726473020f3331303132323339333530303030330314323032322d30342d32355431353a33303a30305a0407313030302e303005063135302e3030" and the equeal right base64  is " AQxCb2JzIFJlY29yZHMCDzMxMDEyMjM5MzUwMDAwMwMUMjAyMi0wNC0yNVQxNTozMDowMFoEBzEwMDAuMDAFBjE1MC4wMA==" .

NOT currect base64  is "MDEwRDQ4NDE0QzQxMjA0MTU1NTQ0RjIwNDM2RjJFMDIwRjMzMzAzMDM5MzczMzM5MzYzNzMyMzAzMDMwMzAzMzAzMEEzMTM1MkQzMDM4MkQzMjMwMzIzMTA0MDkzNTM1MkMzNDMzMzAyRTMwMzAwNTA4MzcyQzMyMzMzMDJFMzAzMA==" but Base64Encode () is give it .

 

.

Accepted Answer
René Ullrich Accepted Answer Pending Moderation
  1. Wednesday, 15 December 2021 14:39 PM UTC
  2. PowerBuilder
  3. # Permalink
string ls_hex = "010c426f6273205265636f726473020f3331303132323339333530303030330314323032322d30342d32355431353a33303a30305a0407313030302e303005063135302e3030"
Coderobject lcod_hex
blob lblb_hex
string ls_Base64Str


lcod_hex = create Coderobject
lblb_hex = lcod_hex.hexdecode (ls_hex)

ls_Base64Str = lcod_hex.Base64Encode(lblb_hex)

DESTROY lcod_hex

MessageBox ("Base64", ls_Base64Str)
// ls_base64str = "AQxCb2JzIFJlY29yZHMCDzMxMDEyMjM5MzUwMDAwMwMUMjAyMi0wNC0yNVQxNTozMDowMFoEBzEwMDAuMDAFBjE1MC4wMA=="
Comment
  1. Praburaj KarthiKeyan
  2. Thursday, 16 December 2021 13:14 PM UTC
Dear René Ullrich, U R Code Working good. Thanks
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.