Function accepts UTF_8 format and returns hexadecimal value of input

function encodingString ( params )
{
    try
    {
        let hexEncodedString = encode.convert( {
            string: params,
            inputEncoding: encode.Encoding.UTF_8,
            outputEncoding: encode.Encoding.HEX
        } );
        return ( hexEncodedString )
    } catch ( e )
    {
        log.error( "error@encodingString", e )
    }
}

Leave a comment

Your email address will not be published. Required fields are marked *