基于区块链的毕业设计Ethiopian-phone – 埃塞俄比亚电话

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计Ethiopian-phone – 埃塞俄比亚电话 是一篇很好的国外资料

Ethiopian-phone

Set of helper utilities to validate, parse and format Ethiopian phone numbers.

Ethiopian-phone - 埃塞俄比亚电话 Ethiopian-phone - 埃塞俄比亚电话

Features

  • Ethiopian phone number validation and formatting.
  • Find location data of phone numbers.
  • Check whether number is mobile or landline.
  • Works in the browser and Node.JS
  • <4 KB minified and gzipped.

Demo : https://etphone.herokuapp.com

Install

npm install ethiopian-phone

Import

ES6 module

import { validate, findArea } from 'ethiopian-phone'

Node.JS

const etPhone = require('ethiopian-phone')

Import to the browser from a CDN

<script src="https://unpkg.com/ethiopian-phone.js"></script>

Usage

const etPhone = require('ethiopian-phone');  let phone = '0911346652';  etPhone.validate(phone) // True etPhone.format(phone)   // 09 11 34 66 52

Validate

Checks whether given input is a valid Ethiopian phone number.

etPhone.validate('0911885641')     // True etPhone.validate('+251115150126')  // True etPhone.validate('09 11 52 39 17') // True  etPhone.validate('09135692')    // False etPhone.validate('+4604121343') // False

Parse

Cleans up | normalizes phone number.

etPhone.parse('09-21-31-43-32')  // 0921314332 etPhone.parse('+(251)116625697') // 251116625697  // Raises detailed error when input is invalid etPhone.parse('09135692')    // TypeError: Phone number too short etPhone.parse('+460721343') // TypeError: Not Ethiopian phone number

Format

Converts phone number into an easily readable format.

etPhone.format('+251116625697') // 251 112 70 56 97 etPhone.format('0112702784')    // 011 270 27 84 etPhone.format('0911885641')    // 09 11 88 56 41

Find Area

Retrieves location data of given phone number based on area code.

etPhone.findArea('0113215476') // Mekanisa, South West Addis Ababa etPhone.findArea('0112702784') // Asko, Western Addis Ababa  etPhone.findArea('0223319750') // Asela, South East Ethiopia etPhone.findArea('0587764412') // Dejen, North West Ethiopia etPhone.findArea('0916771836') // South Ethiopia
  • Location data is based on https://www.itu.int/oth/T0202000044/en
  • Some of the data might be outdated due to naming changes.
  • Detailed location is only available for Landline numbers, you can get some regional info for mobile phones.
  • The location data for mobile phones only indicates where the simcard was bought from and does not necessarily reflect the current location of the phone.

toLocal

Converts phone number to local | Ethiopian format.

etPhone.toLocal('251911885641')  // 0911885641 etPhone.toLocal('+251116625697') // 0116625697

toInternational

Converts phone number to International format.

etPhone.toInternational('0911885641') // +251911885641 etPhone.toInternational('0116625697') // +251116625697

isMobile

Checks whether given number is a mobile sim.

etPhone.isMobile('0911885641') // True etPhone.isMobile('0116625697') // False

isLandline

Checks whether given number is a landline.

etPhone.isLandline('0116625697') // True etPhone.isLandline('0911885641') // False

isLocal

Checks whether given number is in local | Ethiopian format.

etPhone.isLocal('0911885641')    // True etPhone.isLocal('+251116625697') // False

isInternational

Checks whether given number is in international format.

etPhone.isInternational('+251116625697') // True etPhone.isInternational('0911885641')    // False

Test

$ npm run test

License

MIT © Michael Tsegaye

We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. Learn more.


Ethiopian-phone

Set of helper utilities to validate, parse and format Ethiopian phone numbers.

Ethiopian-phone - 埃塞俄比亚电话 Ethiopian-phone - 埃塞俄比亚电话

Features

  • Ethiopian phone number validation and formatting.
  • Find location data of phone numbers.
  • Check whether number is mobile or landline.
  • Works in the browser and Node.JS
  • <4 KB minified and gzipped.

Demo : https://etphone.herokuapp.com

Install

npm install ethiopian-phone

Import

ES6 module

import { validate, findArea } from 'ethiopian-phone'

Node.JS

const etPhone = require('ethiopian-phone')

Import to the browser from a CDN

<script src="https://unpkg.com/ethiopian-phone.js"></script>

Usage

const etPhone = require('ethiopian-phone');  let phone = '0911346652';  etPhone.validate(phone) // True etPhone.format(phone)   // 09 11 34 66 52

Validate

Checks whether given input is a valid Ethiopian phone number.

etPhone.validate('0911885641')     // True etPhone.validate('+251115150126')  // True etPhone.validate('09 11 52 39 17') // True  etPhone.validate('09135692')    // False etPhone.validate('+4604121343') // False

Parse

Cleans up | normalizes phone number.

etPhone.parse('09-21-31-43-32')  // 0921314332 etPhone.parse('+(251)116625697') // 251116625697  // Raises detailed error when input is invalid etPhone.parse('09135692')    // TypeError: Phone number too short etPhone.parse('+460721343') // TypeError: Not Ethiopian phone number

Format

Converts phone number into an easily readable format.

etPhone.format('+251116625697') // 251 112 70 56 97 etPhone.format('0112702784')    // 011 270 27 84 etPhone.format('0911885641')    // 09 11 88 56 41

Find Area

Retrieves location data of given phone number based on area code.

etPhone.findArea('0113215476') // Mekanisa, South West Addis Ababa etPhone.findArea('0112702784') // Asko, Western Addis Ababa  etPhone.findArea('0223319750') // Asela, South East Ethiopia etPhone.findArea('0587764412') // Dejen, North West Ethiopia etPhone.findArea('0916771836') // South Ethiopia
  • Location data is based on https://www.itu.int/oth/T0202000044/en
  • Some of the data might be outdated due to naming changes.
  • Detailed location is only available for Landline numbers, you can get some regional info for mobile phones.
  • The location data for mobile phones only indicates where the simcard was bought from and does not necessarily reflect the current location of the phone.

toLocal

Converts phone number to local | Ethiopian format.

etPhone.toLocal('251911885641')  // 0911885641 etPhone.toLocal('+251116625697') // 0116625697

toInternational

Converts phone number to International format.

etPhone.toInternational('0911885641') // +251911885641 etPhone.toInternational('0116625697') // +251116625697

isMobile

Checks whether given number is a mobile sim.

etPhone.isMobile('0911885641') // True etPhone.isMobile('0116625697') // False

isLandline

Checks whether given number is a landline.

etPhone.isLandline('0116625697') // True etPhone.isLandline('0911885641') // False

isLocal

Checks whether given number is in local | Ethiopian format.

etPhone.isLocal('0911885641')    // True etPhone.isLocal('+251116625697') // False

isInternational

Checks whether given number is in international format.

etPhone.isInternational('+251116625697') // True etPhone.isInternational('0911885641')    // False

Test

$ npm run test

License

MIT © Michael Tsegaye

We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. Learn more.

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/18974.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计Ethiopian-phone – 埃塞俄比亚电话

提供最优质的资源集合

立即查看 了解详情