IR followed by 24 digits (2-digit check + 3-digit bank code + 19-digit account part). Persian Tools provides validation via isShebaValid and rich info lookup via getShebaInfo.
Functions
isShebaValid(shebaCode)
boolean. Uses the ISO 7064 mod-97 check with chunked arithmetic (no BigInt, browser-safe).
getShebaInfo(shebaCode)
Returns rich bank info — or null if the Sheba is invalid or the bank code isn’t in the table.
ShebaResultWithAccountNumber (accountNumberAvailable: true). Otherwise it’s ShebaResultWithoutAccountNumber (accountNumberAvailable: false).
Types
accountNumberAvailable flag is a discriminant — narrow the union with it:
Exported regexes
Pitfalls
- The validator is
isShebaValid, notverifySheba. NoverifyShebafunction exists. - The bank’s Persian name is
persianName, notbankName. There is nobankNamefield. - No automatic whitespace handling. Strip spaces in the caller:
code.replace(/\s/g, "").toUpperCase(). - No automatic Persian/Arabic digit normalization. Run
autoConvertDigitsToENupstream if input may contain them.
Source
src/modules/sheba/index.ts, src/modules/sheba/helpers.ts (chunked mod-97), src/modules/sheba/codes.skip.ts (bank table) · Tests: test/sheba.spec.ts