Skip to content

Commit 6edea3e

Browse files
committed
fix(iban-generator): update check digit calculation to use codePointAt for better Unicode support
1 parent 279dab8 commit 6edea3e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/tools/iban-generator/iban-generator.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function generateIban() {
124124
function calculateCheckDigits(countryCode: string, bban: string) {
125125
// IBAN check digits according to ISO 7064
126126
let replaced = `${bban + countryCode}00`;
127-
replaced = replaced.replace(/[A-Z]/g, c => (c.charCodeAt(0) - 55).toString());
127+
replaced = replaced.replace(/[A-Z]/g, c => (c.codePointAt(0)! - 55).toString());
128128
129129
const remainder = BigInt(replaced) % 97n;
130130
const check = 98n - remainder;

0 commit comments

Comments
 (0)