[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] 01/04: pad IBAN checksum
From: |
gnunet |
Subject: |
[libeufin] 01/04: pad IBAN checksum |
Date: |
Sat, 13 Nov 2021 12:52:14 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
commit 2a438b1e515e2dffff379c59d6e21026b5cc7294
Author: ms <ms@taler.net>
AuthorDate: Wed Nov 10 17:08:49 2021 +0100
pad IBAN checksum
---
util/src/main/kotlin/iban.kt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/util/src/main/kotlin/iban.kt b/util/src/main/kotlin/iban.kt
index cf1fc005..b2de9351 100644
--- a/util/src/main/kotlin/iban.kt
+++ b/util/src/main/kotlin/iban.kt
@@ -7,6 +7,9 @@ fun getIban(): String {
val bban = (0..3).map {
(0..9).random()
}.joinToString("") // 4 digits BBAN.
- val checkDigits =
"98".toBigInteger().minus("$bban$ccNoCheck".toBigInteger().mod("97".toBigInteger()))
+ var checkDigits =
"98".toBigInteger().minus("$bban$ccNoCheck".toBigInteger().mod("97".toBigInteger())).toString()
+ if (checkDigits.length == 1) {
+ checkDigits = "0${checkDigits}"
+ }
return "DE$checkDigits$bban"
}
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.