The creditor_reference_util functions contain various functions for working with Creditor Reference Numbers.

Normalize

#include <string>

#include <qrinvoice/util/creditor_reference_util.hpp>
// ...

std::string normalized_creditor_reference = qrinvoice::creditor_reference_util::normalize_creditor_reference("RF45 1234 5123 45");
std::cout << normalized_creditor_reference << std::endl;
// prints "RF451234512345"

Format

#include <string>

#include <qrinvoice/util/creditor_reference_util.hpp>
// ...

std::string formatted_creditor_reference = qrinvoice::creditor_reference_util::format_creditor_reference("RF451234512345");
std::cout << formatted_creditor_reference << std::endl;
// prints "RF45 1234 5123 45"