Python and Javascript code to validate south african id numbers