Convert string to bytes
(Created page with "When you need to convert a string to a UTF8 byte array (a blob) go like this: orgdata.StringToBase64.Base64ToBlob Here is an example of calculating a complex token for Svea-p...") |
No edit summary |
||
Line 10: | Line 10: | ||
<nowiki> </nowiki> ) | <nowiki> </nowiki> ) | ||
) | ) | ||
[[Category:OCL]] |
Revision as of 08:21, 2 December 2022
This page was created by Hans.karlsen on 2022-03-21. Last edited by Edgar on 2025-01-20.
When you need to convert a string to a UTF8 byte array (a blob) go like this:
orgdata.StringToBase64.Base64ToBlob
Here is an example of calculating 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 ) )