Skip to content

Instantly share code, notes, and snippets.

View ghislainfrs's full-sized avatar

Ghislain Fresnais ghislainfrs

View GitHub Profile
@ghislainfrs
ghislainfrs / EAN13CheckDigitHelper.swift
Last active April 1, 2020 15:28
Generate EAN13 check digit in Swift
//
// EAN13CheckDigitHelper.swift
//
import Foundation
public struct EAN13CheckDigitHelper {
public enum EAN13Error: Error {
case mustOnlyContainDigits
case mustBe12DigitsLong