Skip to content

Instantly share code, notes, and snippets.

View caioremedio's full-sized avatar
😡

Caio caioremedio

😡
View GitHub Profile
@caioremedio
caioremedio / cpfValidator.swift
Last active January 2, 2018 23:39
Swift CPF Validator
static func isValidCPF(_ CPF: String) -> Bool {
//
// CPF must have 14 full characters, and 11 numeric values
//
if CPF.count != 14 { return false }
let cpfDigits = CPF.numericValues()
if cpfDigits.count != 11 { return false }