X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/031fcd433e233cf31c4ee732883940d9b8c8165a..ce024cc2ec8438c906824afe3a634d928b5cf92e:/src/clave_fija.cpp diff --git a/src/clave_fija.cpp b/src/clave_fija.cpp index 71f6f0d..ea8c09e 100644 --- a/src/clave_fija.cpp +++ b/src/clave_fija.cpp @@ -2,10 +2,9 @@ #include #include "clave_fija.h" -ClaveFija::ClaveFija (int n, uint bd) +ClaveFija::ClaveFija (int n) { data = n; - block_data = bd; } ClaveFija::ClaveFija (uchar *n) @@ -46,7 +45,21 @@ bool ClaveFija::operator == (const Clave &c) const uchar *ClaveFija::ToRaw (uint &size) const { - size = Size (); - return ToArray (); + std::stringstream ss; + + ss << "["; + ss << data; + ss << "]"; + ss << "["; + ss << block_data; + ss << "]"; + + std::string s = ss.str (); + + uchar *out = new uchar[s.size ()]; + memcpy (out, s.c_str (), s.size ()); + + size = s.size (); + return out; }