pesels

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2019 License: MIT Imports: 3 Imported by: 0

README

Package pesels provides utilities for working with Polish PESEL numbers.

GoDoc Build Status

Usage examples

See validating and decoding examples.

Documentation

Overview

Package pesels provides utilities for working with Polish PESEL numbers.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = errors.New("invalid input string")

Functions

func Valid

func Valid(pesel string) bool

Valid reports wheter `pesel` represents a valid PESEL number (e.g. has a valid checksum).

Types

type PESEL

type PESEL struct {
	DateOfBirth   time.Time
	OrdinalNumber int
	Sex           Sex
	CheckDigit    int
}

func Decode

func Decode(pesel string) (PESEL, error)

Decode decodes valid `pesel` into a `PESEL`. It returns `ErrInvalid` if `pesel` does not represent a valid PESEL number. Date of birth is parsed in the Europe/Warsaw time zone.

type Sex

type Sex int
const (
	Female Sex = iota
	Male
)

func (Sex) String

func (s Sex) String() string

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL