37
Views
4
Comments
Solved
String conversion to Hexadecimal
Question

How to convert text data to hexadecimal data  in ODC ?

2024-12-02 13-16-47
Vipin Yadav
Solution

I have created an example in O11 Reactive for the client side. You can do something similar in ODC. 

Demo url: https://vyadav.outsystemscloud.com/FrontEnd/TextToHexadecimal


FrontEnd.oml
2020-07-21 19-28-50
Rajat Agrawal
Champion

Hi @Kritikz 
use below java script to convert String into Hexadecimal format

function stringToHex(str) {

    let hexString = '';

    for (let i = 0; i < str.length; i++) {

        hexString += str.charCodeAt(i).toString(16);

    }

    return hexString.toUpperCase();  


Regards,

Rajat




2024-12-02 13-16-47
Vipin Yadav

Hi @Kritikz,

To convert a string to hexadecimal on the server side, you need to develop an extension. 

// C# Server-Side Hexadecimal Conversion 

public string ConvertToHex(string input) {    

string hex = "";    

foreach (char c in input) {        

hex += ((int)c).ToString("X2");    

}    

return hex; 

Thanks,

Vipin Yadav


2024-12-02 13-16-47
Vipin Yadav
Solution

I have created an example in O11 Reactive for the client side. You can do something similar in ODC. 

Demo url: https://vyadav.outsystemscloud.com/FrontEnd/TextToHexadecimal


FrontEnd.oml
2024-10-15 05-27-39
Kritikz
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.