Modulus10.js test
import { Modulus10 } from "https://code4fukui.github.io/Modulus10.js/Modulus10.js"; num.onkeyup = num.onchange = () => { const s = num.value.replace(/-/g, ""); const flg = Modulus10.check(s); mes.textContent = flg ? "valid!" : "invalid..."; num.style.backgroundColor = flg ? "lightgreen" : "pink"; console.log(Modulus10.calc(s)); };
Lib:
Modulus10.js src on GitHub