Validating idenity linksys
I need to find out how could a female and a male share the same identity number?We all know that female ID numbers start with the number 0 after date of birth and the male ID numbers start with the number 5. NET webservice to validate South African Person ID numbers.It provides validation of a person ID by calculating the check-digit (digit-13), and extracts the date-of-birth, gender, citizenship, sequence and other information.
A great mathematical mind an Business man will sorely be missed. I assume that if there are SA citizens with an ID from the year 1900, that this would use the same year number: '00'. However, I am not sure if you can distinguish a '1900' ID from a '2000' ID etc.
I needed to convert to so here is my code if anybody needs a conversion in a hurry: Public Function parse Id No(By Val id No As String) As Boolean Try Dim a As Integer = 0 For i As Integer = 0 To 5 a = CInt(id No.
Substring(i * 2, 1)) Next Dim b As Integer = 0 For i As Integer = 0 To 5 b = b * 10 CInt(id No.
One explanation might be that that the last THREE digits indicated race group in the old days and was done away with after the ANC came to power. Thanks for any help Thanks for this link - it has given me the inspiration to clean up this blog entry - I have also added the link at the top of the text - hopefully there will be less enquiries for ID status etc. */ WHEN no_data_found THEN lv_rply := FALSE; return lv_rply; WHEN OTHERS THEN cs_raise_exception(SQLCODE, SQLERRM, 'CS_VALID_SA_ID_NUMBER'); END; OK, I've seen the errors of my ways and got it to work! Here's the Oracle PL/SQL code: CREATE OR REPLACE FUNCTION FN_VALID_SA_ID_NUMBER ( p_id_number IN VARCHAR2 ) RETURN BOOLEANAS /* ===================================================================== This function was adapted from a TSQL function written by Craig Peacock on Donal Slemon Date: 2008/08/12 Description ----------- Validates an SA ID number.
(Returns 1=valid; 0=invalid) ===================================================================== */ lv_A NUMBER := 0; -- Holds Negative Index numbers (in odd number position) lv_B VARCHAR2(7) := null; -- Holds Positive Index numbers (in even number position) lv_B_num number(8,0) := 0; -- Holds Positive Index numbers lv_C NUMBER; lv_D NUMBER := -1; -- ~The check digit variable lv_I NUMBER; -- Counter Variable lv_dob NUMBER; lv_valid_dob BOOLEAN := FALSE; lv_is_valid NUMBER; lv_last_number NUMBER; lv_rply BOOLEAN := FALSE; lv_length NUMBER; lv_length_err EXCEPTION; BEGIN-- check length not 13 THEN lv_is_valid := 0; RAISE lv_length_err ; --RETURN lv_rply; END IF;-- check if first 6 digits are valid date (not strictly speaking necessary) lv_dob := substr(p_id_number,0,6); IF lv_dob IS NOT NULL AND to_date(lv_dob,'YYMMDD') IS NOT NULL THEN lv_valid_dob := TRUE; ELSE RETURN lv_rply; END IF; lv_I := 0 ;-- adding every odd position digit (starting pos 1)(result goes into lv_A) WHILE (lv_I 0) LOOP lv_C := lv_C lv_B_num mod 10; lv_B_num := ROUND(lv_B_num / 10); END LOOP; --WHILE */-- Add answer of lv_A to answer of lv_C -- Subtract the second digit (e.g. The number must tally with the last number in the ID Number.