This function answers the question whether a given string is a formally valid OCR-number.
If the OCR-number includes a length check digit then length validation should be enabled by setting the second input argument appropriatly.
Returns 1 if the OCR-number is formally valid and 0 otherwise.