aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2023-10-23 08:52:10 +0200
committerGitHub <[email protected]>2023-10-23 06:52:10 +0000
commitbd197037c02df63bd81b6289ecbd8769111ae7b9 (patch)
treeee361f5ae9f5d144e18ab9306f55d929fd4d5ffa /src/modules
parent2ba232e0ebaa4a48ed6df6f7349a00d4a7097608 (diff)
downloadfaker-bd197037c02df63bd81b6289ecbd8769111ae7b9.tar.xz
faker-bd197037c02df63bd81b6289ecbd8769111ae7b9.zip
chore: substrings of length one (#2496)
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/helpers/luhn-check.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/helpers/luhn-check.ts b/src/modules/helpers/luhn-check.ts
index ba68b41d..42fbe1a5 100644
--- a/src/modules/helpers/luhn-check.ts
+++ b/src/modules/helpers/luhn-check.ts
@@ -28,7 +28,7 @@ function luhnChecksum(str: string): number {
let sum = 0;
let alternate = false;
for (let i = str.length - 1; i >= 0; i--) {
- let n = Number.parseInt(str.substring(i, i + 1));
+ let n = Number.parseInt(str[i]);
if (alternate) {
n *= 2;
if (n > 9) {