Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

OpenInsight also includes it's own "HEX" encoder via the OConv function. However, this encoder does not encode delimiters. This may be useful if you're encoding elements in an array. However, if you are encoding binary data, then the SRP_Encode "HEX" algorithm will serve more useful.

Use SRP Decode when you need to convert back to binary data.

The CharacterSet parameter allows you to customize the characterset used for BASE32 or BASE64. Leaving this blank uses the standard character set recognized by most decoders, including the one built into OpenInsight. If you run into a scenario in which the built-in character set causes issues, then you can customize the character set to fit your needs. Note, however, that you will need to pass the exact same character set to SRP Decode in order to restore the data as intended.

The Options parameter is dependent upon the algorithm chosen. Currently, only the BASE64 algorithm supports a single option. By default, the BASE64 algorithm inserts CRLFs in the encoding per industry standards. Setting Options to 0 omits the CRLFs. SRP_Decode has no such Options parameter as it is smart enough to ignore CRLFs whether or not they are there.

...

Code Block
* HEX encode some binary data
Data = \D1D2D3D4\
EncodedData = SRP_Encode(Data, "HEX")
 
Code Block
* BASE32 encode some binary data
Data = \D1D2D3D4\
EncodedData = SRP_Encode(Data, "BASE32")

...

Code Block
* BASE64 encode some binary data
Data = \D1D2D3D4\
EncodedData = SRP_Encode(Data, "BASE64")