Skip to content

rmelian2014/DNI-CIF-NIFValidatorSwift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Spanish DNI, CIF, NIF validator

Description

This is a single class repo, intended to help with Spain DNI, CIF, NIT validation, was created because the lack of this in the internet, we search and results are almost 0, and in Swift well we can´t find any except this https://gist.github.com/gservera, this code is used as part of our integral solution, so we use as reference the code founded in this web page : http://www.lawebdelprogramador.com/codigo/JavaScript/1992-Validar-un-CIF-NIF-y-DNI.html, and here https://gist.github.com/gservera and we add some improvements.

Usage

You only need to add the SwiftDNICIFNITValidator.swift class to your project and use the static method called validateCIF this will return true if is valid or false if not

Test Numbers

Almost all test numbers came from http://generadordni.es/

Example

SwiftDNICIFNITValidator.validateCIF(cifCandidate: "F08216863") will return true SwiftDNICIFNITValidator.validateCIF(cifCandidate: " aaaa41d") will return false

Autors

Reinier Melian Massip email: [email protected]

Vladimir Sanchez Mondeja email: [email protected]

About

Validator for Spanish DNI CIF NIF in 100% Swift

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages