From ab67c412220051d6a96be8c65179ee29712bf006 Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Mon, 30 Mar 2015 14:28:21 +0200 Subject: [PATCH] fromHexString exaplanation --- source/core/functions.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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); -- 2.20.1