All Projects → twcclegg → Libphonenumber Csharp

twcclegg / Libphonenumber Csharp

Licence: apache-2.0
Offical C# port of https://github.com/googlei18n/libphonenumber

Programming Languages

csharp
926 projects

Projects that are alternatives of or similar to Libphonenumber Csharp

nova-phone-number
A Laravel Nova field to format and validate phone numbers.
Stars: ✭ 60 (-84.85%)
Mutual labels:  phone-number
phone-number-geo
离线查询手机号归属地
Stars: ✭ 88 (-77.78%)
Mutual labels:  phone-number
Countrycodepicker
Country Code Picker (CCP) is an android library which provides an easy way to search and select country phone code ( national code ) for the telephone number.
Stars: ✭ 259 (-34.6%)
Mutual labels:  phone-number
botkit-sms
Twilio Programmable SMS implementation for Botkit.
Stars: ✭ 18 (-95.45%)
Mutual labels:  phone-number
react-headless-phone-input
Headless phone number input component for React. Because phone numbers are hard.
Stars: ✭ 25 (-93.69%)
Mutual labels:  phone-number
intl-tel-input-rails
intl-tel-input for the Rails asset pipeline
Stars: ✭ 35 (-91.16%)
Mutual labels:  phone-number
PhoneVerificationController
A nicer UI for FireBase phone authentication.
Stars: ✭ 30 (-92.42%)
Mutual labels:  phone-number
Awesome Phonenumber
Google's libphonenumber pre-compiled with the closure compiler
Stars: ✭ 357 (-9.85%)
Mutual labels:  phone-number
naija-phone-number
A fast minimal module to validate Nigerian mobile phone numbers using Regular Expressions.
Stars: ✭ 43 (-89.14%)
Mutual labels:  phone-number
react-native-phone-number-input
React Native component for phone number.
Stars: ✭ 206 (-47.98%)
Mutual labels:  phone-number
magento2-sign-in-with-phone-number
This extension allow your customers to login to your Magento store using their phone number.
Stars: ✭ 42 (-89.39%)
Mutual labels:  phone-number
Reborn
ReborN SMS BOMBER | SpeedX & 4NAT
Stars: ✭ 126 (-68.18%)
Mutual labels:  phone-number
haoma
手机固话电话号码标记批量查询📞📌
Stars: ✭ 52 (-86.87%)
Mutual labels:  phone-number
getcontact
Find info about user by phone number using GetContact API
Stars: ✭ 228 (-42.42%)
Mutual labels:  phone-number
Awesome Falsehood
😱 Falsehoods Programmers Believe in
Stars: ✭ 16,614 (+4095.45%)
Mutual labels:  phone-number
international-telephone-input
Integration to Magento 2 a jQuery plugin for entering and validating international telephone numbers.
Stars: ✭ 26 (-93.43%)
Mutual labels:  phone-number
CHRTextFieldFormatter
Provides UITextField formatting masks. Such as phone number and credit card number formatters.
Stars: ✭ 52 (-86.87%)
Mutual labels:  phone-number
Libphonenumber For Php
PHP version of Google's phone number handling library
Stars: ✭ 3,938 (+894.44%)
Mutual labels:  phone-number
Anyformatkit
Simple text formatting in Swift
Stars: ✭ 296 (-25.25%)
Mutual labels:  phone-number
ember-phone-input
An Ember.js component to handle international phone numbers
Stars: ✭ 22 (-94.44%)
Mutual labels:  phone-number

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.

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

Building

  • This library targets several frameworks. As such to build the solution as is .NET Portable Library targeting pack and .NET Framework 3.5 development tools must be installed and finally copy the portable files to the dotnet sdk: xcopy "C:\Program Files (x86)\MSBuild\Microsoft\Portable" "C:\Program Files\dotnet\sdk\$(dotnet --version)\Microsoft\Portable\" /S /E
  • Alternately to avoid these dependencies the PhoneNumbers.csproj can be edited to exclude unneeded frameworks.

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].