Validate QR References

This is how you validate a QR reference number, which was formerly known as ISR reference number (inpayment slip with reference number).

import ch.codeblock.qrinvoice.util.QRReferenceUtils;

// ...

System.out.println(QRReferenceUtils.isValidQrReference("11 00012 34560 00000 00008 13457"));
System.out.println(QRReferenceUtils.isValidQrReference("110001234560000000000813457"));
// prints true

System.out.println(QRReferenceUtils.isValidQrReference("11 00012 34560 00000 00008 13456"));
// prints false, due to wrong checksum

Validate Creditor References

This is how you validate a structured creditor reference (ISO 11649) using the CreditorReferenceUtils class.

import ch.codeblock.qrinvoice.util.CreditorReferenceUtils;

// ...

System.out.println(CreditorReferenceUtils.isValidCreditorReference("RF45 1234 5123 45"));
// prints true