All Projects → EeeMt → phone-number-geo

EeeMt / phone-number-geo

Licence: MIT license
离线查询手机号归属地

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to phone-number-geo

flutter otp
A Flutter package for iOS and Android for sending and verifying OTP to a Phone number.
Stars: ✭ 59 (-32.95%)
Mutual labels:  phone-number
international-telephone-input
Integration to Magento 2 a jQuery plugin for entering and validating international telephone numbers.
Stars: ✭ 26 (-70.45%)
Mutual labels:  phone-number
Reborn
ReborN SMS BOMBER | SpeedX & 4NAT
Stars: ✭ 126 (+43.18%)
Mutual labels:  phone-number
NumBuster-API
Fully reversed NumBuster app for android, and rewrited all requests for numbuster`s api in python.
Stars: ✭ 15 (-82.95%)
Mutual labels:  phonenumber
Phonedata
手机归属地查询C#版本
Stars: ✭ 26 (-70.45%)
Mutual labels:  phonedata
getcontact
Find info about user by phone number using GetContact API
Stars: ✭ 228 (+159.09%)
Mutual labels:  phone-number
Stringformatter
Simple Text Formetter (Credit Card Number, Phone Number, Serial Number etc.) Can be used in all text inputs according to the format pattern. If desired, large minor character restrictions can be made in the format pattern.
Stars: ✭ 231 (+162.5%)
Mutual labels:  phone-number
naija-phone-number
A fast minimal module to validate Nigerian mobile phone numbers using Regular Expressions.
Stars: ✭ 43 (-51.14%)
Mutual labels:  phone-number
PhoneVerificationController
A nicer UI for FireBase phone authentication.
Stars: ✭ 30 (-65.91%)
Mutual labels:  phone-number
PhoneNumberKit
Android Kotlin library to parse and format international phone numbers. Country code picker.
Stars: ✭ 124 (+40.91%)
Mutual labels:  phone-number
disposable-phone-numbers
A list of disposable phone numbers
Stars: ✭ 35 (-60.23%)
Mutual labels:  phone-number
static-calltracking
Скрипт подмены номеров для статического коллтрекинга
Stars: ✭ 18 (-79.55%)
Mutual labels:  phone-number
botkit-sms
Twilio Programmable SMS implementation for Botkit.
Stars: ✭ 18 (-79.55%)
Mutual labels:  phone-number
csv2vcf
🔧 Simple script in python to convert CSV files to VCF
Stars: ✭ 66 (-25%)
Mutual labels:  phone-number
Socially
Socially is a textView which is able to create separate clickable views according to your requirements.
Stars: ✭ 28 (-68.18%)
Mutual labels:  phonenumber
Faker
A library for generating fake data such as names, addresses, and phone numbers.
Stars: ✭ 231 (+162.5%)
Mutual labels:  phone-number
nova-phone-number
A Laravel Nova field to format and validate phone numbers.
Stars: ✭ 60 (-31.82%)
Mutual labels:  phone-number
tz-trout
Helps you figure out the time zone based on an address or a phone number.
Stars: ✭ 14 (-84.09%)
Mutual labels:  phonenumber
react-headless-phone-input
Headless phone number input component for React. Because phone numbers are hard.
Stars: ✭ 25 (-71.59%)
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 (-52.27%)
Mutual labels:  phone-number

手机归属地查询

Maven Central Build Status javadoc Coverage Status GitHub

简介

根据手机号确定手机号运营商即归属地, 支持包括虚拟运营商的中国大陆手机号查询.

数据源

数据源dat文件来自xluohome/phonedata提供的数据库, 会不定时同步更新数据库

当前数据源版本: 202108

maven

<dependency>
    <groupId>me.ihxq.projects</groupId>
    <artifactId>phone-number-geo</artifactId>
    <version>x.x.x-xxxxxx</version>
</dependency>

这里获取最新版号.

版本号解释:

示例

class Demo1{
    public static void main(String[] args){
        PhoneNumberLookup phoneNumberLookup = new PhoneNumberLookup();
        PhoneNumberInfo found = phoneNumberLookup.lookup("18798896741").orElseThrow(RuntimeException::new);
    }
}
class Demo2{
    public static void main(String[] args){
        PhoneNumberLookup phoneNumberLookup = new PhoneNumberLookup();
        String province = phoneNumberLookup.lookup("130898976761")
                        .map(PhoneNumberInfo::getAttribution)
                        .map(Attribution::getProvince)
                        .orElse("未知");
    }
}
class Demo3{
    public static void main(String[] args){
        PhoneNumberLookup phoneNumberLookup = new PhoneNumberLookup();
        PhoneNumberInfo found = phoneNumberLookup.lookup("18798896741").orElseThrow(RuntimeException::new);
        found.getNumber(); // 18798896741
        found.getAttribution().getProvince(); // 贵州
        found.getAttribution().getCity(); // 贵阳
        found.getAttribution().getZipCode(); // 550000
        found.getAttribution().getAreaCode(); // 0851
        found.getIsp(); // ISP.CHINA_MOBILE
    }
}

对比libphonenumber

对比libphonenumber, libphonenumber有更多功能, 包括验证号码格式, 格式化, 时区等, 但基于xluohome/phonedata提供的dat数据库能囊括包含虚拟运营商号段的更多号段.

至于速度, 未做比较, 但本仓库实现已足够快, 选择时建议更多权衡易用性, 功能和数据覆盖范围.

Benchmark

工程里已内置四种算法, 跑分情况如下:

Benchmark                                   Mode  Cnt        Score       Error  Units
BenchmarkRunner.anotherBinarySearchLookup   avgt    5      390.483 ±     3.544  ns/op
BenchmarkRunner.binarySearchLookup          avgt    5      386.357 ±     3.739  ns/op
BenchmarkRunner.prospectBinarySearchLookup  avgt    5      304.622 ±     1.899  ns/op
BenchmarkRunner.sequenceLookup              avgt    5  1555265.227 ± 48814.379  ns/op

性能测试源码位于me.ihxq.projects.pna.benchmark.BenchmarkRunner, 基于JMH

测试样本在每次启动时生成, 供所有算子测试使用, 所以每次测试结果有差异, 结果可用于横向比较, 不适用于纵向比较.

默认使用的是me.ihxq.projects.pna.algorithm.BinarySearchAlgorithmImpl, 可以通过new PhoneNumberLookup(new AlgorithmYouLike());使用其他算法;

也可自行实现算法, 实现me.ihxq.projects.pna.algorithm.LookupAlgorithm即可.

感谢

Todo

  • 发布到maven中央仓库
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].