E pili ana i ka ikaika o ka IBAN

E like me ka mea i ʻike ʻia, aia ka German IBAN i ke code ʻāina (DE), kahi helu helu helu ʻelua (e like me ISO 7064 ), ka helu panakō (8-helu) a me ka helu helu (me ka helu sub-account. Hoʻopiha ʻia nā huahelu 10, nā huahelu nalo i nā helu alakaʻi) a no laila he 22 -helu. No ka helu ʻana i ka huahelu helu, ua hoʻokumu ʻia ka BBAN (code bank and account number) a me ka helu ʻāina helu \(1314\) no Kelemānia a me ka helu helu helu \(00\) ) .


No ka laʻana, ʻo ke code bank 21050170 a me ka helu helu 12345678 e hoʻihoʻi i ka BBAN 210501700012345678, i hoʻonui ʻia me ka helu ʻāina a me ka helu helu 00 a laila e loaʻa i ka \(x = 210501700012345678131400\) \(98 - (x \mod 97)\) . ʻAʻole ia he mea pōʻino ua māhele ʻia kēia e \(97\) . ʻOiai ʻo ia ka helu kumu ʻelua-helu nui loa, ʻike ʻo ia i nā helu kuhi hewa e like me nā huahelu i hoʻololi ʻia me ka nui o ka hiki. Hōʻike mākou i kēia mau ʻōlelo:

  1. ʻO ka hoʻololi ʻana i hoʻokahi huahelu o ka IBAN kūpono e hopena i kahi IBAN kūpono ʻole.
  2. ʻO ka hoʻololi ʻana i ʻelua huahelu ʻokoʻa o kahi IBAN kūpono hiki ke hopena i kahi IBAN kūpono.
  3. Inā hoʻololi ʻia ʻelua kūlana ʻokoʻa o kahi IBAN kūpono, hana ʻia kahi IBAN kūpono ʻole.
  4. Inā hoʻololi ʻoe i ʻelua kūlana ʻokoʻa o kahi IBAN kūpono ʻelua, hiki i kahi IBAN kūpono ke hopena.

E $$A = DE P_1 P_2 N_1 N_2 N_3 N_4 N_5 N_6 N_7 N_8 N_9 N_{10} N_{11} N_{12} N_{13} N_{14} N_{15} N_{16} N_{17} N_{18}$$ he IBAN kūpono.

A laila $$A_B = N_1 N_2 N_3 N_4 N_5 N_6 N_7 N_8 N_9 N_{10} N_{11} N_{12} N_{13} N_{14} N_{15} N_{16} N_{17} N_{18} 131400$$ ka BBAN pili (i hoʻonui ʻia me ka helu ʻāina helu DE a me ka helu helu \(00\) ).

  1. E hoʻololi i kēia manawa \(N_k\), ʻo ia \(A_B^* = A_B + l \cdot 10^{24-k}\) me \(1 \leq k \leq 18\) a \((-1) \cdot N_k \leq l \leq 9-N_k \wedge l \neq 0\). Me \( P = 98 - (A_B \mod 97) \) aka \(P^* = 98 - \left((A_B + l \cdot 10^{24-k}) \mod 97\right) \). Pili maʻamau i \( a \equiv a' \mod m, b \equiv b' \mod m \): \(a + b \equiv a' + b' \mod m\). Me \(A_B \equiv R_1 \mod 97\) a \(l \cdot 10^{24-k} \equiv R_2 \mod 97\) ʻo ia \( (A_B + l \cdot 10^{24-k}) \equiv R_1 + R_2 \mod 97 \). Akā i kēia manawa \( 0 < R_2 < 97 \) a penei \( P^* = 98 - (R_1+R_2) \neq 98 - R_1 = P \) a nolaila \( P_1 \neq P_1^* \vee P_2 \neq P_2^* \). Hoʻokahi wale nō hoʻololi o kahi huahelu mai kēia \( P \) i \( P^* \neq P \). Eia aka \( N_k \) ʻaʻole i loli, hana ʻia ka checksum \( P \neq P^* \).
  2. Pono kēia mau IBAN ʻelua:
    $$\begin{align} A_1 = DE89207300\boldsymbol{\color{red}01}0012345674 \\ A_2 = DE89207300\boldsymbol{\color{red}98}0012345674 \end{align}$$ ʻO kēia kahi āu e pono ai , ua hoʻonui mākou i ʻelua huahelu pili i \(A_1\) na \(97\) . Eia kekahi, ʻaʻole kūpono wale ka IBAN, akā aia nā code bank underlying 20730001 a me 20730098.
  3. Hoao mua makou, \( N_{k_1} \) a \( N_{k_2} \) e hoololi. ʻO ka mua \( P = 98 - (A_B \mod 97) \) e like me \(P^* = 98 - \left((A_B + l \cdot 10^{24-k_1} - l \cdot 10^{24-k_2}) \mod 97\right) \) me \(l = N_{k_2} - N_{k_1}\) a \(1 \leq k_1, k_2 \leq 18\). I kēia manawa ma muli o

    $$\begin{array} {|c|c|} \hline k & R = 10^{24-k} \mod 97 \\ \hline 1 & 56 \\ \hline 2 & 25 \\ \hline 3 & 51 \\ \hline 4 & 73 \\ \hline 5 & 17 \\ \hline 6 & 89 \\ \hline 7 & 38 \\ \hline 8 & 62 \\ \hline 9 & 45 \\ \hline 10 & 53 \\ \hline 11 & 15 \\ \hline 12 & 50 \\ \hline 13 & 5 \\ \hline 14 & 49 \\ \hline 15 & 34 \\ \hline 16 & 81 \\ \hline 17 & 76 \\ \hline 18 & 27 \\ \hline \end{array}$$
    \( \forall k_1 \neq k_2 \in \left\{ 1, \ldots, 18 \right\} : R_{k_1} \neq R_{k_2}\). Pela no \( P \neq P^* \). No laila ke mau nei ka nānā ʻana i kēlā \(P_n\) a \(N_k\) me \( 1 \leq n \leq 2 \) a \( 1 \leq k \leq 18 \) kālepa. Malia paha \(P = 98 - (A_B \mod 97)), (R_1 = (A_B \mod 97)\), \(P^* = 98 - (A_B + (l \cdot 10^{24-k}) \mod 97)\), \(R_2 = (A_B + (l \cdot 10^{24-k}) \mod 97)\). Mai ko makou \(A_B\) a puni \(l \cdot 10^{24-k}\) pono mākou e hoʻololi \(P_1\) a i ʻole \(P_2\) a puni \(-l\), pela \(P\) a puni \(-10^m l\) me \(m \in \{0,1\}\) hoololi: A laila \(P^* = 98 - R_2\) aka \(P^* = P - 10^m l = 98 - R_1 - 10^m l\), no laila \(R_2 = R_1 + 10^m l,\) a penei
    $$((A_B \mod 97) + (l \cdot 10^{24-k} \mod 97)) \mod 97 = (A_B \mod 97) + 10^m l$$ Eia naʻe, ʻaʻole i hoʻokō ʻia kēia hoohalike, e like me ka hōʻike ʻana o ka palapala ma lalo nei:

    See the Pen IBAN FORMULA CHECK by David Vielhuber (@vielhuber) on CodePen.

    Ke waiho nei kēia i kahi hoʻololi hiki wale o \(P_1\) a \(P_2\). Eia aka \( N_k \) ʻaʻole i loli, hana ʻia ka checksum \( P \neq P^* \).
  4. Pono kēia mau IBAN ʻelua:
    $$\begin{align*}A_1 = DE\boldsymbol{\color{red}8}\boldsymbol{\color{green}3}20220800\boldsymbol{\color{red}1}000000\boldsymbol{\color{green}0}00 \\ A_2 = DE\boldsymbol{\color{red}1}\boldsymbol{\color{green}0}20220800\boldsymbol{\color{red}8}000000\boldsymbol{\color{green}3}00\end{align*}$$ Eia kekahi, aia maoli ka BIC 20220800.
Hope