CreditCodeUtil

Introduction

The unified social credit code system for legal persons and other organizations is equivalent to giving legal persons and other organizations a nationally unified “identity card number”.

The rules are as follows:

  1. Part 1: Registration Authority Code (1 digit - numeric or uppercase letter)
  2. Part 2: Organization Category Code (1 digit - numeric or uppercase letter)
  3. Part 3: Registration Authority’s Administrative Division Code (6 digits - numeric)
  4. Part 4: Main Body Identification Code (Organization Code) (9 digits - numeric or uppercase letter)
  5. Part 5: Check Code (1 digit - numeric or uppercase letter)

This tool mainly provides verification and random generation.

Usage

Verification

String testCreditCode = "91310110666007217T";
// true
CreditCodeUtil.isCreditCode(testCreditCode);

Random Generation of Social Credit Code

final String s = CreditCodeUtil.randomCreditCode();