From: Eduardo Ramos Testillano Date: Mon, 30 Mar 2015 12:28:21 +0000 (+0200) Subject: fromHexString exaplanation X-Git-Tag: REFACTORING_TESTING_LIBRARY~204 X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=commitdiff_plain;h=ab67c412220051d6a96be8c65179ee29712bf006 fromHexString exaplanation --- 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);