🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: hk.comp.pc
Article #1

Re: calculate hkid check digit program

#1
From: Sherine
Date: Wed, 12 Apr 2023 06:16
32 lines
2653 bytes
On Tuesday, 6 January 1998 at 16:00:00 UTC+8, Philip Lam wrote:
> On Tue, 06 Jan 1998 23:48:55 +0800, PAUL MAK <z...@netvigator.com>
> wrote:
> > I am looking for the source code/algorithm of calculation of hkid
> >card check digit.
> Hi Paul,
> You may try the following algorithm :
> Calculation of the check digit:
> ===============================
> For example, the HKID no. is A123456
> ^^
> 1) If there is a "blank" before "A", just like our case, it is treated
> as a "]" (91 in ASCII)
> 2) For other characters, just apply the ASCII value of that character
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> in the following formula. (A=65, B=66, .....)
> 3) A = 65 in ASCII
> Total = 91*9 + 65*8 + 1*7 + 2*6 + 3*5 + 4*4 + 5*3 + 6*2
> ^^
> "]" in ASCII
> = 1416
> MOD(total) with 11 ==> 1416 / 11 = 128 ... 8 (Remainder)
> Check digit = 11 - Remainder = 11 - 8 = 3
> Therefore the HKID no. is A123456(3)
> Check on yourself 'n see if it helps...
> Philip Lam
> (NOSPAM....@hk.super.net)
> << Remove "NOSPAM." when reply >>


I am wondering why is MOD(total) with 11? why 11? 
Thanks 
Technical Details
Message-ID: <f66ece6d-c46f-4a33-a77d-d938f2244cc4n@googlegroups.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!nnrp.usenet.blueworldhosting.com!!spool1.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news.uzoreto.com!peer01.ams4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
References: <34B25266.374DB0FE@netvigator.com> <34b266f3.485372@news.hk.super.net>#1/1>

Show Full Headers
Complete Article Headers
Message-ID: <f66ece6d-c46f-4a33-a77d-d938f2244cc4n@googlegroups.com>
Subject: Re: calculate hkid check digit program
Date: Wed, 12 Apr 2023 06:16:57 +0000
From: Sherine <sherine3050@gmail.com>
References: <34B25266.374DB0FE@netvigator.com> <34b266f3.485372@news.hk.super.net>#1/1>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!nnrp.usenet.blueworldhosting.com!!spool1.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news.uzoreto.com!peer01.ams4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
X-Received: by 2002:ac8:130d:0:b0:3e8:d6cb:4b4 with SMTP id e13-20020ac8130d000000b003e8d6cb04b4mr25434qtj.0.1681280218301;
X-Received: by 2002:a25:d141:0:b0:b75:8ac3:d5da with SMTP id
 i62-20020a25d141000000b00b758ac3d5damr6454518ybg.4.1681280218029; Tue, 11 Apr
Newsgroups: hk.comp.pc
In-Reply-To: <34b266f3.485372@news.hk.super.net>#1/1>
Injection-Info: google-groups.googlegroups.com; posting-host=14.0.175.122; posting-account=VB1HpAoAAABWP_3uWN7sa9v2AnwjVYJ_
NNTP-Posting-Host: 14.0.175.122
User-Agent: G2/1.0
MIME-Version: 1.0
Injection-Date: Wed, 12 Apr 2023 06:16:58 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2320