UNPKG
genthaiid
Version:
latest (2.0.2)
2.0.2
2.0.1
2.0.0
1.0.1
1.0.0
better thaiid
github.com/PingHuskar/genthaiid
PingHuskar/genthaiid
genthaiid
/
src
/
getLastDigit.js
11 lines
•
272 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
export
default
(firsttwelvedigits) => {
return
( (
11
- (firsttwelvedigits .
split
(
""
) .
map
(
(
i, idx
) =>
parseInt
(i) * (
13
- idx)) .
reduce
(
(
a, b
) =>
a + b,
0
) %
11
)) %
10
); }