BIC generation is not realistic #1159
Labels
c: bug
Something isn't working
m: finance
Something is referring to the finance module
s: accepted
Accepted feature / Confirmed bug
Milestone
While looking at the code mentioned in #1158, I noticed that
finance.bic()
generates BIC codes in a weird way that might not be representative of real SWIFT/BIC codes. There are two issues:According to the real SWIFT codes listed on this page (scroll down a bit), it doesn't seem like the 4th character in the code has to be a vowel.
faker/src/modules/finance/index.ts
Lines 403 to 404 in df9c650
helpers.replaceSymbols()
to pick three random uppercase letters and then it appends a random vowel to that. To fix this, we could delete line 404 and replace line 403 withthis.faker.helpers.replaceSymbols('????')
.Also based on the real SWIFT codes mentioned above, it doesn't seem like the 8th char of a SWIFT code is required to be a
1
. However,1
is always the 8th char, because it is hardcoded.faker/src/modules/finance/index.ts
Line 407 in df9c650
Also, is there any possible way we could make this function easier to read? Personally, the ternaries spread over multiple lines make it incredibly hard to read.
The text was updated successfully, but these errors were encountered: