public static String stringToHex(final String data){
  return new String(Hex.encodeHex(ConversionUtils.stringToArray(data)));
}

public static String stringToHex ( final String data ) { return new String ( Hex . encodeHex ( ConversionUtils . stringToArray ( data ) ) ) ; }
converts the given string into a hex string .
