Skip to content

Instantly share code, notes, and snippets.

View jordigarciad's full-sized avatar

Jordi Garcia Duran jordigarciad

View GitHub Profile
@carlos-mg89
carlos-mg89 / gist:4aaafa310c9e4b91f5fb890540f38cae
Created February 25, 2020 13:10
Spanish DNI, CIF, NIE validator
/**
* ValidateSpanishID. Returns the type of document and checks its validity.
*
* Usage:
* ValidateSpanishID( str );
*
* > ValidateSpanishID( '12345678Z' );
* // { type: 'dni', valid: true }
*
* > ValidateSpanishID( 'B83375575' );
@afgomez
afgomez / validate_spanish_id.js
Last active November 6, 2024 12:20
Spanish DNI, CIF, NIE validator
/**
* ValidateSpanishID. Returns the type of document and checks its validity.
*
* Usage:
* ValidateSpanishID( str );
*
* > ValidateSpanishID( '12345678Z' );
* // { type: 'dni', valid: true }
*
* > ValidateSpanishID( 'B83375575' );