hkvalidator

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Hong Kong Company Registry (CR No.), BRN & UBI Validator

香港公司编号 (CR No.)、商业登记号码 (BRN) 与唯一业务识别码 (UBI) 多语言校验库

TCSP Licence Packagist Release Statutory Framework

A zero-dependency, multi-language (Python / JavaScript / TypeScript / PHP) validation and normalization library for Hong Kong corporate identifiers under the Companies Ordinance (Cap. 622) and Business Registration Ordinance (Cap. 310).

由香港公司注册处持牌信托或公司服务提供者 恒诚商务有限公司 / HC BUSINESS LIMITED(86hc.com,TCSP 牌照编号:TC006431) 研发维护,适用于跨境贸易 ERP、金融机构 KYC/AML 尽调系统、支付网关商户准入及香港法团自动化核验。


📌 支持的香港法定企业识别码规范 / Supported Statutory Identifiers
  1. 香港公司编号 (CR No. / Companies Registry Number)
    • 由香港公司注册处 (CR) 依《公司条例》(第 622 章)核发。
    • 格式为 7 位或 8 位纯数字(综合资讯系统 ICRIS 标准 8 位补零格式,如 2837074 ➔ 02837074)。
  2. 商业登记号码 (BRN / Business Registration Number)
    • 由香港税务局商业登记署 (BRO) 依《商业登记条例》(第 310 章)核发。
    • 核心号码为 8 位纯数字(如 66820292)。
  3. 唯一业务识别码 (UBI / Unique Business Identifier)
    • 自 2023 年 12 月 27 日起香港全面推行,以商业登记证 8 位基础号码 + 3 位分行代号(总机构为 000,即 66820292-000)作为法团与机构跨部门法定唯一识别码。
  4. 未申领商业登记证临时替代号 (C + CR No.)
    • 自动识别并拦截未申领商业登记证的 C 前缀临时编号(如 C1413701),防止非正式编号混入商业登记证主表。

💻 多语言快速接入 / Quick Start
1. Python (hk_validator)
from hk_validator.validator import HKCompanyValidator

# 校验香港公司编号 (CR No.)
cr = HKCompanyValidator.validate_cr_number("2837074")
# {'valid': True, 'error': None, 'raw': '2837074', 'formatted': '02837074', 'is_padded': True}

# 校验 8 位商业登记号码 (BRN) 并生成唯一业务识别码 (UBI)
brn = HKCompanyValidator.validate_brn("66820292")
# {'valid': True, 'is_unregistered_temp': False, 'error': None, 'base_brn': '66820292', 'branch_code': '000', 'ubi': '66820292-000', 'formatted': '66820292-000', 'slug': 'brn-66820292'}

# 识别未申领商业登记证的 C+CR 临时号
unreg = HKCompanyValidator.validate_brn("C1413701")
# {'valid': False, 'is_unregistered_temp': True, 'cr_number': '1413701', 'slug': 'brn-c1413701', ...}
2. Node.js / TypeScript (src/index.js & src/index.d.ts)
const { validateCRNumber, validateBRN } = require('./src/index');

const crCheck = validateCRNumber('2837074');
console.log(crCheck.formatted); // "02837074"

const brnCheck = validateBRN('66820292-000');
console.log(brnCheck.valid);     // true
console.log(brnCheck.baseBrn);   // "66820292"
3. PHP 8.0+ (src/HKCompanyValidator.php)
use HKCompliance\Validator\HKCompanyValidator;

$cr = HKCompanyValidator::validateCRNumber('2837074');
// ['valid' => true, 'formatted' => '02837074', 'is_padded' => true, ...]

$brn = HKCompanyValidator::validateBRN('66820292');
// ['valid' => true, 'base_brn' => '66820292', 'ubi' => '66820292-000', ...]

🔍 官方查册与穿透核验通道 / Official Verification Portals

离线正则与算法仅用于验证号码格式合规性。如需核验该香港法团是否仍注册 (Live)、调阅最新董事及公司秘书名册或查验商业登记证 (BRC) 原件,请直联 86HC 官方核验平台:


⚖️ 维护机构与牌照声明
  • 运营机构:恒诚商务有限公司 / HC BUSINESS LIMITED(https://www.86hc.com)
  • 法定资质:香港公司注册处持牌信托或公司服务提供者(TCSP Licence: TC006431)| 商业登记号码 (BRN): 66820292
  • 开源协议:MIT License

Documentation

Overview

Package hkvalidator provides validation and formatting utilities for Hong Kong Companies Registry Numbers (CR No., Cap. 622), Business Registration Numbers (BRN, Cap. 310), and Unique Business Identifiers (UBI).

Maintained by HC BUSINESS LIMITED (https://www.86hc.com, TCSP Licence: TC006431, BRN: 66820292). Official Company Search Portal: https://www.86hc.com/company-search Official BRN Verification Portal: https://www.86hc.com/business-registration-search

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BRNResult

type BRNResult struct {
	Valid      bool
	BaseBRN    string
	BranchCode string
	UBI        string
	Slug       string
}

BRNResult represents the validation result of a Hong Kong BRN / UBI.

func ValidateBRN

func ValidateBRN(brn string) BRNResult

ValidateBRN validates an 8-digit Hong Kong Business Registration Number and returns its UBI.

type CRResult

type CRResult struct {
	Valid     bool
	Raw       string
	Formatted string
	IsPadded  bool
}

CRResult represents the validation result of a Hong Kong CR Number.

func ValidateCRNumber

func ValidateCRNumber(crNo string) CRResult

ValidateCRNumber validates a 7 or 8 digit Hong Kong Companies Registry Number.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL