Official Content

This is part of SecurityAPI Encoders. It encodes and decodes the Hexadecimal representation of characters on Strings. It is based on Bouncy Castle Hex Encoder and iterates between bytes on low-level implementation.

HexaEncoder

Hexadecimal strings management functions.

ToHexa

HexaEncoder.ToHexa(plainText)
  • Input: VarChar(256) plain text
  • Returns: VarChar(256) hexadecimal representation of a text

Receives a character and returns the hexadecimal representation of the text.

It uses UTF-8 by default unless CryptographyEncodingUtil is used.

Example:

&hexaText = &HexaEncoder.ToHexa("hello world")

FromHexa

HexaEncoder.FromHexa(stringHexa)
  • Input: VarChar(256) hexadecimal representation of a text
  • Returns: VarChar(256) plain text

Receives a hexadecimal character and returns the plain text version of the input.

Example:

&plainText = &HexaEncoder.FromHexa("0956D2FBD5D5C29844A4D21ED2F76E0C")

IsHexa

This method is available since GeneXus 17 Upgrade 8

HexaEncoder.IsHexa(stringHexa)
  • Input: VarChar(256) string hexadecimal to verify
  • Returns: Boolean true if it is a valid hexadecimal 

Receives a string and verifies if it is a correct hexadecimal representation.

Example:

&isHexa = &HexaEncoder.IsHexa("0956D2FBD5D5C29844A4D21ED2F76E0C")




Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant