{"id":13514812,"url":"https://github.com/khellang/Redskap","last_synced_at":"2025-03-31T03:31:30.735Z","repository":{"id":66283749,"uuid":"343570164","full_name":"khellang/Redskap","owner":"khellang","description":"A collection of blazing fast 🏎️💨 Norwegian 🇳🇴 utilities with a ✨ modern API ✨","archived":false,"fork":false,"pushed_at":"2024-09-26T06:01:59.000Z","size":743,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-28T16:48:00.874Z","etag":null,"topics":["norway","norwegian","parser","utilities","validator"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khellang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-01T22:06:02.000Z","updated_at":"2024-11-11T18:20:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"65341763-c8db-4baa-b539-f0b39e9d5a70","html_url":"https://github.com/khellang/Redskap","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khellang%2FRedskap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khellang%2FRedskap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khellang%2FRedskap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khellang%2FRedskap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khellang","download_url":"https://codeload.github.com/khellang/Redskap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246413377,"owners_count":20773053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["norway","norwegian","parser","utilities","validator"],"created_at":"2024-08-01T05:01:02.137Z","updated_at":"2025-03-31T03:31:25.728Z","avatar_url":"https://github.com/khellang.png","language":"C#","funding_links":[],"categories":["C#"],"sub_categories":[],"readme":"# 🇳🇴 Redskap\n\nCurrently there's only one utility in the library, `IdentificationNumber`, which lets you parse, validate and generate Norwegian National Identity Numbers. More utilities are coming!\n\nThe library targets .NET Standard 2.0 and .NET 5, which means it's supported on pretty much any .NET platform still supported by Microsoft.\n\n## Parsing\n\nThe library supports parsing fødselsnummer, D-nummer and H-nummer. This is done through the various overloads of `IdentificationNumber.Parse` and `IdentificationNumber.TryParse`.\nThere's also a few overloads of `IsValid` to validate that a string is a valid identification number (of a specified type).\nAdditionally, there are convenience methods for parsing out date of birth (using `TryParseDateOfBirth`) and gender (using `TryParseGender`) directly.\n\nParsing is built on modern APIs such as `ReadOnlySpan\u003cT\u003e`, which makes it really fast and completely allocation free. See benchmarks below.\n\n### Benchmarks\n\nThe results of the [`IsValidIdentificationNumberBenchmark`](https://github.com/khellang/Redskap/blob/main/perf/Redskap.Benchmarks/IsValidIdentificationNumberBenchmark.cs) on .NET 8:\n\n| Method    | Mean        | Error     | StdDev    | Ratio | RatioSD | Gen0   | Allocated | Alloc Ratio |\n|---------- |------------:|----------:|----------:|------:|--------:|-------:|----------:|------------:|\n| Redskap   |    27.63 ns |  0.291 ns |  0.272 ns |  1.00 |    0.00 |      - |         - |          NA |\n| Nonin     |   118.67 ns |  1.315 ns |  1.098 ns |  4.30 |    0.06 | 0.0315 |     264 B |          NA |\n| NoCommons |   265.39 ns |  2.474 ns |  2.314 ns |  9.61 |    0.15 | 0.0458 |     384 B |          NA |\n| Tedd      | 1,357.05 ns | 11.306 ns | 10.023 ns | 49.10 |    0.57 | 0.2995 |    2512 B |          NA |\n| NinEngine |   329.70 ns |  1.598 ns |  1.495 ns | 11.93 |    0.11 | 0.0153 |     128 B |          NA |\n\n## Generation\n\nThe library also supports generating valid fødselsnummer, D-nummer and H-nummer.\nThis is done through the various overloads of `IdentificationNumber.Generate`. These let you specify kind, gender, date of birth and/or a min- and max date.\nIf you want to control the randomness of the generation, e.g. for unit testing, you can create your own instance of `IdentificationNumber.Generator` and pass in your own (seeded) `Random` instance. See [this unit test](https://github.com/khellang/Redskap/blob/b2b6ae87542825d379793ef6c8b1508012786616/test/Redskap.Tests/IdentificationNumberTests.cs#L43-L61) as an example.\n\n### Benchmarks\n\nThe results of the [`GenerateIdentificationNumberBenchmark`](https://github.com/khellang/Redskap/blob/main/perf/Redskap.Benchmarks/GenerateIdentificationNumberBenchmark.cs) on .NET 8:\n\n| Method    | Mean           | Error        | StdDev       | Ratio    | RatioSD | Gen0    | Gen1   | Allocated | Alloc Ratio |\n|---------- |---------------:|-------------:|-------------:|---------:|--------:|--------:|-------:|----------:|------------:|\n| Redskap   |       140.6 ns |      1.02 ns |      0.85 ns |     1.00 |    0.00 |       - |      - |         - |          NA |\n| NoCommons | 1,161,481.9 ns | 12,681.80 ns | 11,862.56 ns | 8,275.50 |   80.83 | 66.4063 | 7.8125 |  566769 B |          NA |\n| NinEngine |     1,632.0 ns |     28.36 ns |     26.53 ns |    11.58 |    0.19 |  0.3681 |      - |    3092 B |          NA |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhellang%2FRedskap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhellang%2FRedskap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhellang%2FRedskap/lists"}