1234567890-1234-checksum(1234567890-1234).substring(0, 6)
where 1234567890 is the account number, 1234 is the short code, and then 6 characters are typed in at the end are a checksum.
The short code is unique. So if you type in the correct checksum but not the correct short-code the fully-qualified unique identifier does not pass the validation step. Like-wise, if you type in the correct short-code but not the checksum then the unique identifier also does not pass the validation step. Thus, the user is protected against typing in an incorrect short code.
The bank account numbers have had check digits since 1967!
In most cases the sort code is included in the checksum
https://www.vocalink.com/media/3513/vocalink-validating-acco...