Coder Social home page Coder Social logo

SI IBAN prefix about schwifty HOT 10 CLOSED

mdomke avatar mdomke commented on June 19, 2024
SI IBAN prefix

from schwifty.

Comments (10)

mdomke avatar mdomke commented on June 19, 2024

As far as I read the documentation from the link you provided the checksum digits are still calculated conforming to the IBAN specification. My assumption is that the BBAN specific checksum is computed in a way, so that the IBAN check digits are always 56. Is that correct?
Nevertheless I'm not sure from your issue description if there is actually a problem with the implementation. If so could you please elaborate what your problem actually is?

from schwifty.

mdomke avatar mdomke commented on June 19, 2024

Ping @Prome88

from schwifty.

Prome88 avatar Prome88 commented on June 19, 2024

Hi,
as im quite new to github, I've mistakenly open an issue instead of an forum thread.

Yes you are correct, maybe it would be clearer with the example from wikipedia:

SIkk bbss sccc cccc cxx

k = IBAN check digits (always = "56")
b = National bank code
s = Branch code
c = Account number
x = National check digits

Few countries do not utilize the IBAN in full and have some fixed numbers / characters, usually as IBAN check digits.

The question is if IBAN.generate() supports / will support this deviation(s)/addendum(s) from IBAN standard?

from schwifty.

cbuctok avatar cbuctok commented on June 19, 2024

Also I cannot get BIC from a valid SI IBAN.
Is this project dead?

from schwifty.

berend avatar berend commented on June 19, 2024

Getting BICs from the bank code of an IBAN is not done via some algorithm. It is a fixed list, where you have to lookup the bank code (that is part of the IBAN). We implemented that for Germany, since there is an official source that is more or less machine readable. You can have a look how that is done in this repository here.

If there is such a list to get a mapping bank code to BIC for all slowenian banks, let us know or create a pull requests.

We looked into this a while back, but there where no good sources for this kind of information.

from schwifty.

berend avatar berend commented on June 19, 2024

Also, back to topic on @Prome88 issue - let me try to understand your problem:

Slowenian IBANs consist of SIkk bbss sccc cccc cxx where xx is a checksum for the BBAN part of the IBAN (meaning bbss sccc cccc c, so that the kk IBAN checksum is always 56.

And you want to generate a IBAN by just having National bank code (b), branch code (s) and the account number (c), but not the internal checksum (x).

Is that correct?

Is there a source on the algorithm, that is behind that checksum?

from schwifty.

Prome88 avatar Prome88 commented on June 19, 2024

Central bank of Slovenia has this list available from:
https://www.bsi.si/placila-in-infrastruktura/placilne-storitve-in-elektronski-denar/identifikacijske-oznake-in-kode-bic

And the offical explanation on the algorithm:
https://www.bsi.si/placila-in-infrastruktura/placilne-storitve-in-elektronski-denar/placilni-in-transakcijski-racun

from schwifty.

berend avatar berend commented on June 19, 2024

The list of BICs is appreciated, thanks! It is not as machine readable as it could be (.csv, .json or .xml), but at least - a list!

Regarding generation of the BBAN checksums, I did not find any algorithm on the website you linked, also not on linked webpages (in slowenian) like this one , but the php lib for handling IBANs has the same issue here (open for over 2 years). It contains some resources - and as far as I could see also the wanted algorithm for Slowenia.

I draw two conclusions here:

  • it is a lot of work
  • we should base the work here on their collected list
  • help is welcome!

@Prome88 Did i understand your problem correctly (two comments up)?

from schwifty.

kdolinar avatar kdolinar commented on June 19, 2024

Hi, let me post a follow-up on this matter. The algorithm is specified (albeit in Slovene language), if you follow some of the links above to an official law amendment. To spare you the inconvenience, let me briefly sketch the algorithm:

First of all you should know that each slovene BBAN is suffixed with two control digits so that modulo 97 you will always get 1. So BBAN % 97 = 1 always.

IBAN validation:

  1. Take BBAN and concatenate to get the following string: BBAN<S><I>00 (here <S> = "28" and <I> = "18").
  2. Divide the resulting number by modulo 97. As BBAN % 97 = 1, then BBAN<S><I>00 % 97 is always constant, namely 42.
  3. Replace 00 at the end with control digits 56 and you will always get BBAN<S><I>56 % 97 = 1.

Hence, in order to get a valid IBAN, you should always use 56 as control digits in the "SEPA header" (right after the country code) for every slovene IBAN.

Of course, in order to facilitate a full-fledged BBAN validation, a special functional block should be added to Schwifty to manipulate IBANs by their corresponding BBAN validation algorithm, which is frankly speaking a lot of work. However, as a slightly better approximation of a full Slovene IBAN validation, a simple modification of SEPA specification »SI2!n5!n8!n2!n« can be made by using the right control digits 56 instead of 2!n.

So, put at least »SI565!n8!n2!n« and you'll be slightly better off with Slovene IBAN validation. In fact, I have created a pull request #12 with this modification and some other improvements of the Schwifty internal IBAN spec JSON DB. Please review ...

from schwifty.

mdomke avatar mdomke commented on June 19, 2024

Fixed by #12

from schwifty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.