Javascript validation for Bech32 BIP173 bitcoin addresses.
<script src="bech32-js.min.js"></script>
var result = checkbech32('abcdef1qpzry9x8gf2tvdw0s3jn54khce6mua7lmqqqxw')
// => 'OK'
var result = checkbech32('wrongabcdef1qpzry9x8gf2tvdw0s3jnkhce6muawrong')
// => 'KO'
- bitcoinjs contributors for the Bech32 encoding/decoding library
- Peter Wuille for the reference JavaScript implementation, and for authoring the Bech32 BIP173