// Convert a colour to a 6-digit hex string static wxString ColourToHexString(const wxColour& col) { wxString hex; hex += wxDecToHex(col.Red()); hex += wxDecToHex(col.Green()); hex += wxDecToHex(col.Blue()); return hex; }
wxString wxColStr ( wxColour c ) { unsigned char r, g, b ; r = c.Red (); g = c.Green (); b = c. Blue (); // possible Unicode bug here wxString s = wxDecToHex(r) + wxDecToHex(g) + wxDecToHex(b) ; return s ; }
wxString GOrgueHash::getStringHash() { getHash(); wxString result = wxEmptyString; for(unsigned i = 0; i < 20; i++) result += wxDecToHex(m_Hash.hash[i]); return result; }
bool Crypt(const wxString &sText, wxString &sCryptText) { sCryptText.Clear(); const wxString sPass(PASSWD); size_t pos(0); for(size_t i = 0; i < sText.Len(); ++i) { if(pos == sPass.Len()) pos = 0; wxUint32 val1 = sText[i]; wxUint32 val2 = sPass[pos]; wxUint32 Symbol = val1 ^ val2; char SymbolHi = hibyte(Symbol); char SymbolLo = lobyte(Symbol);//(Symbol >> 4) & 0xff; sCryptText += wxDecToHex(SymbolHi); sCryptText += wxDecToHex(SymbolLo); pos++; } return true; }
// Convert decimal integer to 2-character hex string wxString wxDecToHex(int dec) { wxChar buf[3]; wxDecToHex(dec, buf); return wxString(buf); }
// Convert decimal integer to 2-character hex string (not prefixed by 0x). wxString wxDecToHex(unsigned char dec) { wxChar buf[3]; wxDecToHex(dec, buf); return wxString(buf); }