Convert string to bytes
m ((username removed) (log details removed): Moving to Documentation namespace)
(Replacing message template with parser tag)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<message>Write the content here to display this box</message>
To convert a string to a UTF8 byte array (a blob), do this:
To convert a string to a UTF8 byte array (a blob), do this:
  orgdata.StringToBase64.Base64ToBlob
  orgdata.StringToBase64.Base64ToBlob
Line 11: Line 12:
  )
  )
  [[Category:OCL]]
  [[Category:OCL]]
{{Edited|July|12|2024}}

Latest revision as of 07:40, 17 June 2024

To convert a string to a UTF8 byte array (a blob), do this:

orgdata.StringToBase64.Base64ToBlob

Here is an example of how to calculate a complex token for Svea-pay:

-- as defined in https://checkoutapistage.svea.com/docs/#/getting-started
let orgdata=requestbody+SveaSettingsSingleton.oclSingleton.MerchantSecret+timestamp in
(
  let thehash=SysSingleton.oclSingleton.SHA512ComputeHash(orgdata.StringToBase64.Base64ToBlob) in
  (
    (SveaSettingsSingleton.oclSingleton.MerchantId+':'+SysSingleton.oclSingleton.BitConverterToString( thehash ).Replace('-','')).StringToBase64
  )
)
This page was edited 95 days ago on 06/17/2024. What links here