Skip to content

Instantly share code, notes, and snippets.

@satreix
Forked from revolunet/valid-secu.py
Created April 30, 2014 15:16
Show Gist options
  • Save satreix/e6901fabaee38dc4b6d9 to your computer and use it in GitHub Desktop.
Save satreix/e6901fabaee38dc4b6d9 to your computer and use it in GitHub Desktop.
def validInsee(insee, cle):
# http://fr.wikipedia.org/wiki/Numero_de_Securite_sociale#Unicit.C3.A9
# gestion numeros corses
insee = insee.replace('A', 0)
insee = insee.replace('B', 0)
reste = int(insee) % 97
return ((97 - reste) == int(cle))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment