libphonenumber-csharp 8.13.13

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package libphonenumber-csharp --version 8.13.13                
NuGet\Install-Package libphonenumber-csharp -Version 8.13.13                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="libphonenumber-csharp" Version="8.13.13" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add libphonenumber-csharp --version 8.13.13                
#r "nuget: libphonenumber-csharp, 8.13.13"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install libphonenumber-csharp as a Cake Addin
#addin nuget:?package=libphonenumber-csharp&version=8.13.13

// Install libphonenumber-csharp as a Cake Tool
#tool nuget:?package=libphonenumber-csharp&version=8.13.13                

Build status codecov NuGet

C# port of Google's libphonenumber library.

The code was rewritten from the Java source mostly unchanged, please refer to the original documentation for sample code and API documentation.

The original Apache License 2.0 was preserved.

See this for details about the port.

Phonenumber metadata is updated in the Google repo approximately every two weeks. This library is manually updated to include the latest metadata, usually within a day or so. There is currently plans to fully automate this https://github.com/twcclegg/libphonenumber-csharp/issues/172

Example

  var phoneNumberUtil = PhoneNumbers.PhoneNumberUtil.GetInstance();
  var e164PhoneNumber = "+44 117 496 0123";
  var nationalPhoneNumber = "2024561111";
  var smsShortNumber = "83835";
  var phoneNumber = phoneNumberUtil.Parse(e164PhoneNumber, null);
  phoneNumber = phoneNumberUtil.Parse(nationalPhoneNumber, "US");
  phoneNumber = phoneNumberUtil.Parse(smsShortNumber, "US");

Features

  • Parsing/formatting/validating phone numbers for all countries/regions of the world.
  • GetNumberType - gets the type of the number based on the number itself; able to distinguish Fixed-line, Mobile, Toll-free, Premium Rate, Shared Cost, VoIP and Personal Numbers (whenever feasible).
  • IsNumberMatch - gets a confidence level on whether two numbers could be the same.
  • GetExampleNumber/GetExampleNumberByType - provides valid example numbers for 218 countries/regions, with the option of specifying which type of example phone number is needed.
  • IsPossibleNumber - quickly guessing whether a number is a possible phonenumber by using only the length information, much faster than a full validation.
  • AsYouTypeFormatter - formats phone numbers on-the-fly when users enter each digit.
  • FindNumbers - finds numbers in text input

ToDo

  • port read/write source xml data to binary for better performance and smaller .nupkg size (WIP)
  • update / add / port new unit tests and logging from java source

How to unfold automatic generated files

  • Install Jetbrains - Resharper for Visual Studio
  • File by file, right click and "Cleanup code"
  • Check the unfolded file

Available on NuGet as package libphonenumber-csharp.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (114)

Showing the top 5 NuGet packages that depend on libphonenumber-csharp:

Package Downloads
N3O.Umbraco.Validation

TODO

OrchardCore.Users

Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. The Users module adds user management functionality.

OrchardCore.Application.Cms.Core.Targets

Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. Converts the application into a modular OrchardCore CMS application with TheAdmin theme but without any front-end Themes.

TheTheme

Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. The default Theme - Can be used as base theme for new themes.

OrchardCore.Application.Cms.Targets

Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. Converts the application into a modular OrchardCore CMS application with following themes. - TheAdmin Theme - SafeMode Theme - TheAgency Theme - TheBlog Theme - TheComingSoon Theme - TheTheme theme

GitHub repositories (4)

Showing the top 4 popular GitHub repositories that depend on libphonenumber-csharp:

Repository Stars
OrchardCMS/OrchardCore
Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
ONLYOFFICE/CommunityServer
Free open source office suite with business productivity tools: document and project management, CRM, mail aggregator.
notifo-io/notifo
Multi channel notification service for collaboration tools, e-commerce, news service and more.
shr670377723/CommunityServer-master
Version Downloads Last updated
8.13.49 38,311 11/4/2024
8.13.48 58,895 10/23/2024
8.13.47 218,503 10/4/2024
8.13.46 98,233 9/25/2024
8.13.45 242,354 9/6/2024
8.13.44 160,860 8/26/2024
8.13.43 255,803 8/9/2024
8.13.42 175,516 7/26/2024
8.13.41 20,153 7/25/2024
8.13.40 376,183 7/3/2024
8.13.39 285,176 6/15/2024
8.13.38 160,842 6/5/2024
8.13.37 566,889 5/17/2024
8.13.36 200,714 5/3/2024
8.13.35 300,989 4/19/2024
8.13.34 312,513 4/5/2024
8.13.33 268,083 3/25/2024
8.13.32 256,069 3/12/2024
8.13.31 228,970 2/25/2024
8.13.30 345,633 2/9/2024
8.13.29 328,317 1/26/2024
8.13.28 20,840 1/25/2024
8.13.27 666,332 12/21/2023
8.13.26 492,081 11/29/2023
8.13.25 328,306 11/20/2023
8.13.24 580,272 10/31/2023
8.13.23 342,099 10/17/2023
8.13.22 399,871 9/29/2023
8.13.21 199,306 9/20/2023
8.13.20 316,941 9/7/2023
8.13.19 309,591 8/22/2023
8.13.18 391,973 8/3/2023
8.13.17 136,670 7/27/2023
8.13.16 225,294 7/11/2023
8.13.15 1,661 7/11/2023
8.13.14 676,639 6/15/2023
8.13.13 1,699 6/15/2023
8.13.12 1,712 6/15/2023
8.13.11 1,080,415 4/27/2023
8.13.10 117,490 4/20/2023
8.13.9 202,954 4/10/2023
8.13.8 187,669 3/27/2023
8.13.7 729,066 3/3/2023
8.13.6 549,010 2/10/2023
8.13.5 246,601 1/29/2023
8.13.4 386,145 1/9/2023
8.13.3 420,823 12/22/2022
8.13.2 674,723 12/8/2022
8.13.1 253,672 11/28/2022
8.13.0 538,421 11/8/2022
8.12.57 783,134 10/14/2022
8.12.56 798,825 9/23/2022
8.12.55 500,903 9/9/2022
8.12.54 425,382 8/22/2022
8.12.53 475,418 8/8/2022
8.12.52 483,232 7/19/2022
8.12.51.1 153,965 7/12/2022
8.12.50 821,602 6/13/2022
8.12.49 385,207 6/1/2022
8.12.48 310,708 5/18/2022
8.12.47 6,403 5/18/2022
8.12.46 811,706 4/15/2022
8.12.45 1,131,159 3/14/2022
8.12.44 103,755 3/9/2022
8.12.43 492,651 2/14/2022
8.12.42 1,968 2/14/2022
8.12.41 1,975 2/14/2022
8.12.40 2,065 2/14/2022
8.12.39 2,039 2/14/2022
8.12.38 1,717,175 12/15/2021
8.12.37 2,501 12/15/2021
8.12.36 2,367 12/15/2021
8.12.35 2,152 12/15/2021
8.12.34 1,794,802 10/7/2021
8.12.33 415,968 9/23/2021
8.12.32 224,163 9/11/2021
8.12.31 2,517 9/11/2021
8.12.30 299,166 8/18/2021
8.12.29 2,302 8/18/2021
8.12.28 468,668 7/23/2021
8.12.27 260,659 7/8/2021
8.12.26 147,164 6/25/2021
8.12.25 137,295 6/16/2021
8.12.24 838,244 5/31/2021
8.12.23 247,352 5/13/2021
8.12.22 367,726 4/30/2021
8.12.21 357,903 4/8/2021
8.12.19 610,874 3/2/2021
8.12.18 490,734 2/10/2021
8.12.17 262,184 1/27/2021
8.12.16 147,728 1/15/2021
8.12.15 508,834 12/18/2020
8.12.14 321,973 12/4/2020
8.12.13 511,994 11/18/2020
8.12.11 1,086,103 10/9/2020
8.12.10 190,418 9/29/2020
8.12.9 412,483 9/2/2020
8.12.8 456,091 8/17/2020
8.12.7 508,996 7/21/2020
8.12.6 193,630 7/6/2020
8.12.5 2,634 7/6/2020
8.12.4 521,381 5/21/2020
8.12.3 200,253 5/8/2020
8.12.2 232,741 4/23/2020
8.12.1 524,405 3/31/2020
8.12.0 290,657 3/20/2020
8.11.5 310,498 3/3/2020
8.11.4 296,371 2/13/2020
8.11.3 285,764 2/3/2020
8.11.2 860,955 1/16/2020
8.11.1 395,212 12/12/2019
8.11.0 121,769 11/29/2019
8.10.23 93,826 11/18/2019
8.10.22 55,258 11/14/2019
8.10.21 431,273 10/17/2019
8.10.20 192,333 10/3/2019
8.10.19 190,837 9/21/2019
8.10.18 45,325 9/17/2019
8.10.17 291,949 8/16/2019
8.10.16 91,136 8/5/2019
8.10.15 198,333 7/18/2019
8.10.14 209,306 7/1/2019
8.10.13 443,305 5/31/2019
8.10.12 267,603 5/15/2019
8.10.11 84,709 5/7/2019
8.10.10 134,540 4/17/2019
8.10.9 253,769 4/5/2019
8.10.8 113,278 3/23/2019
8.10.7 148,099 3/11/2019
8.10.6 145,935 2/22/2019
8.10.5 482,942 2/8/2019
8.10.4 192,054 1/25/2019
8.10.3 134,828 1/11/2019
8.10.2 365,808 12/7/2018
8.10.1 64,940 11/29/2018
8.10.0 36,988 11/29/2018
8.9.16 501,117 10/19/2018
8.9.15 120,847 10/6/2018
8.9.14 92,755 9/21/2018
8.9.13 117,091 9/7/2018
8.9.12 226,576 8/25/2018
8.9.11 88,981 8/18/2018
8.9.10 313,975 7/12/2018
8.9.9 77,373 6/29/2018
8.9.8 71,149 6/15/2018
8.9.7 84,007 5/30/2018
8.9.6 129,439 5/16/2018
8.9.5 37,433 5/4/2018
8.9.4 106,350 4/17/2018
8.9.3 40,068 4/5/2018
8.9.2 71,706 3/19/2018
8.9.1 34,137 3/8/2018
8.9.0 49,644 2/22/2018
8.8.11 62,955 2/8/2018
8.8.10 36,792 1/25/2018
8.8.9 215,596 1/10/2018
8.8.8 149,383 12/8/2017
8.8.7 30,603 12/1/2017
8.8.6 68,689 11/17/2017
8.8.5 159,429 10/31/2017
8.8.4 138,040 10/17/2017
8.8.3 63,755 10/6/2017
8.8.2 49,491 9/22/2017
8.8.1 47,434 9/8/2017
8.8.0 113,030 8/22/2017
8.7.1 43,271 8/3/2017
8.7.0.1 55,613 7/21/2017
8.6.0.1 4,698 7/18/2017
8.6.0 42,362 7/10/2017
8.3.1.2 98,049 6/24/2017
8.3.1.1 127,965 3/13/2017
8.3.1 20,897 3/4/2017
7.7.4 333,524 11/13/2016
7.5.1 414,183 8/6/2016
7.2.5 439,480 2/11/2016
7.0.11 151,804 10/5/2015
7.0.9 81,885 8/16/2015
7.0.5.5 79,578 5/27/2015
7.0.5.4 3,186 5/23/2015
7.0.5.3 18,323 4/28/2015
7.0.5.1 2,996 4/27/2015
7.0.5 3,253 4/25/2015
4.10.0.62 299,898 8/21/2012
4.10.0.61 3,121 8/9/2012
4.10.0.59 3,295 7/27/2012
4.10.0.55 3,288 7/19/2012
4.9.0.52 3,199 7/13/2012
4.9.0.43 3,091 7/10/2012
4.9.0.42 3,213 7/9/2012
4.8.0.35 3,342 6/22/2012
4.8.0.33 4,065 6/16/2012
4.8.0.31 3,199 6/7/2012
4.8.0.30 3,900 5/31/2012
4.8.0.24 3,628 5/9/2012
4.7.0.21 4,477 4/28/2012
4.7.0.19 3,181 4/25/2012
4.6.0.16 3,517 3/30/2012
4.6.0.13 13,221 2/10/2012
4.5.0.9 6,885 1/30/2012
4.5.0.6 3,270 1/21/2012
4.5.0.4 4,148 1/20/2012
4.4.0.1 30,134 1/10/2012
3.8.0.400 3,332 11/28/2011
3.8.0.399 3,281 11/27/2011
3.8.0.394 3,312 11/24/2011
3.8.0.342 3,403 9/17/2011
3.7.1.342 3,298 9/17/2011
3.7.1.312 3,254 8/5/2011
3.7.1.306 11,652 8/5/2011