QString str= sha1("Wc+4gwUg+DUqwyyGdHhUxg==258EAFA5-E914-47DA-95CA-C5AB0DC85B11"); qDebug()<<str;//"6cBtYqYBqGB9dIbUSSylAnGjOIE=" QString sha1(QString str) { QByteArray string = str.toLatin1(); QCryptographicHash *hash=new QCryptographicHash(QCryptographicHash::Sha1); hash->addData(string); QByteArray sha1=hash->result(); return sha1.toBase64(); }
QByteArray bb; bb = QCryptographicHash::hash(str.toLatin1(), QCryptographicHash::Sha1); qDebug() << bb.toBase64();