//This program is free software: you can redistribute it and/or modify it under the terms #of the GNU General Public License as published by the Free Software Foundation, either #version 3 of the License, or (at your option) any later version. //This program is distributed in the hope that it will be useful, but WITHOUT ANY #WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A #PARTICULAR PURPOSE. See the GNU General Public License for more details. //You should have received a copy of the GNU General Public License along with this #program. If not, see #include #include #include #include using namespace std; typedef struct { QString hex; QString bin; }representacion; static representacion repre[16]={{"0","0000"},{"1","0001"},{"2","0010"},{"3","0011"}, {"4","0100"},{"5","0101"},{"6","0110"},{"7","0111"}, {"8","1000"},{"9","1001"},{"A","1010"},{"B","1011"}, {"C","1100"},{"D","1101"},{"E","1110"},{"F","1111"},}; char auxHexToAscii(char first, char second) { char hex[5], *stop; hex[0] = '0'; hex[1] = 'x'; hex[2] = first; hex[3] = second; hex[4] = 0; return strtol(hex, &stop, 16); } QString HexToBinary(QString &cadena){ QString devolver=""; QString espacio=" "; for(int i=0; i