The algorithm is based on https://computerterminal.blogspot.com/2005/11/hkid-calculation.html.
Supports multiple languages, see below.
All the libraries are case-insensitive. “a123456a” and “A123456A” are no different.
At source root.
go get github.com/drshapeless/hkid-validator/go/hkidvalidator
import "github.com/drshapeless/hkid-validator/go/hkidvalidator"
// Usage:
// checkHKID(string)
// Returns True or False
hkidvalidator.CheckHKID("A1234567") // Returns False
Compile with the source file, hkidvalidator.c
and hkidvalidator.h
.
#include "hkidvalidator.h"
/* Usage */
/* checkHKID(char *) */
/* Returns 1 or 0 */
/* 1 is true */
checkHKID("A1234567") /* Returns 0 */
Copy hkidvalidator.py
to the project directory.
import hkidvalidator
hkidvalidator.checkHKID("A1234567") # Returns False
Copy hkidvalidator.js
to the project directory.
const v = require("./hkidvalidator.js")
v.checkHKID("A1234567") // Returns false