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