X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;ds=sidebyside;f=source%2Fcore%2Ffunctions.cpp;h=1a6a2910d926cb62e20d41af54f97d42559c6689;hb=7ac94d8f360628b59b7fed8bfbc4509ad055712e;hp=a23a0d1a928d22417d3abcb7b1b6c52cb23695b3;hpb=5256cb543a9d35b610df19bd227cde977186aef0;p=anna.git diff --git a/source/core/functions.cpp b/source/core/functions.cpp index a23a0d1..1a6a291 100644 --- a/source/core/functions.cpp +++ b/source/core/functions.cpp @@ -260,14 +260,16 @@ throw() { } /** - * Obtiene el valor original de una cadena obtenido con #asHexString (const DataBlock&). - * \param hexString Cadena que contiene el bĂșfer. - * \param target Bloque de datos sobre el que decodificar la cadena. - * \return El bloque de datos original correspondiente a la cadena recibida. + * Gets the original value obtained with #asHexString (const DataBlock&). + * \param hexString String which contains the buffer. The format is an hexadecimal octet sequence representation (i.e. 'af012fb3', with even number of digits). + * The input shall be preprocessed to comply with that format (e.g. colon or any other non-hex digit must be removed). + * \param target DataBlock for string decode. + * \return DataBlock corresponding to the provided string. */ //static DataBlock& functions::fromHexString(const std::string& hexString, DataBlock& target) throw(RuntimeException) { + if((hexString.length() % 2) != 0) throw RuntimeException("functions::fromHexString | Invalid string length", ANNA_FILE_LOCATION);