Function to get the length of the parameters and convert the string to hex value

function getLength ( lengthparam )
{
    try
    {
        let length = lengthparam.length
        let orgLength = Number( length ) / 2
        let hexString = orgLength.toString( 16 )
        if ( hexString.length < 2 )
        {
            hexString = "0" + hexString;
        }
            return hexString
    } catch ( e )
    {
        log.error( "error@getLength", e )
    }
}

Leave a comment

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