All pastes #935426 Raw Edit

Stuff

public text v1 · immutable
·published 2008-03-09 17:12 UTC
rendered paste body
    QString s = url.toString();
    QByteArray h = QCryptographicHash::hash(s.toUtf8(), QCryptographicHash::Sha1);
    QString ret;
    const char *data = h.constData();
    for (int i = 0; i < h.size(); i++)
    {   
        char buf[3];
        sprintf(buf, "%02x", (unsigned char)data[i]);
        ret += buf;
    }   

    return ret;