Skip to content
personnummerPublic

About

🔢 Validate Swedish personal identity numbers

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

personnummer

Package Version Hex Docs

gleam add personnummer
import personnummer

pub fn main() {
  let assert Ok(pnr) = personnummer.new("19900101-0017")
  io.debug(
    [
      "The person with personal identity number ",
      pnr
        |> personnummer.format(True),
      " is a ",
      case
        pnr
        |> personnummer.is_male()
      {
        True -> "male"
        False -> "female"
      },
      " of age ",
      pnr
        |> personnummer.age
        |> int.to_string(),
    ]
    |> string.concat,
  )
}
"The person with personal identity number 19900101-0017 is a male of age 34"

Further documentation can be found at https://hexdocs.pm/personnummer.

Development

gleam run   # Run the project
gleam test  # Run the tests
gleam shell # Run an Erlang shell

In memoriam

Fredrik "Frozzare" Forsmo (1991-2026) was the initiator, co-founder and a core contributor of the personnummer project. This library carries his work. He is missed.

About

🔢 Validate Swedish personal identity numbers

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages