Snippet. CPP. Decode Base64 encoded QString to QString

This small CPP snippet shows how to decode a Base64 encoded QString back to QString.

QString base64_decode(QString string){
    QByteArray ba;
    ba.append(string));
    return QByteArray::fromBase64(ba));
}

Updated on: 23 Nov 2024