Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spagettikod/sweid
Go API to validate Swedish Personal Identification and Organisation Numbers
https://github.com/spagettikod/sweid
Last synced: about 1 month ago
JSON representation
Go API to validate Swedish Personal Identification and Organisation Numbers
- Host: GitHub
- URL: https://github.com/spagettikod/sweid
- Owner: spagettikod
- License: bsd-3-clause
- Created: 2016-05-04T18:16:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-05-04T18:17:58.000Z (over 8 years ago)
- Last Synced: 2024-10-19T08:38:43.538Z (3 months ago)
- Language: Go
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sweid
Go API to validate Swedish personal identification (personnummer) and
organisational (organisationsnummer) numbers. Specifications for these
identifiers can be found at the Swedish Tax Agency, http://www.skatteverket.se.## Usage
Call one of the two methods to test a Personal Identification Number (ValidPN) or Organisation Number (ValidON).Valid formats for Personal Identification Numbers:
* YYYYMMDD-NNNN
* YYMMDD-NNNN
* YYYYMMDDNNNN
* YYMMDDNNNNValid formats for Organisation Numbers:
* NNNNNN-NNNN
* NNNNNNNNNN## Example
```
package mainimport (
"fmt"
"github.com/spagettikod/sweid"
)func main() {
if ValidPN("640823-3234") {
fmt.Println("Correct Personal Identification Number!")
} else {
fmt.Println("Invalid Personal Identification Number!")
}
}
```