catamphetamine / libphonenumber-js

A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript
https://catamphetamine.gitlab.io/libphonenumber-js/
MIT License
2.77k stars 217 forks source link

Add MSISDN formatting support #195

Closed NinnOgTonic closed 6 years ago

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 456f099f9395e89d142908ac085b429ef4ee1ca7 on NinnOgTonic:master into 8918ac895f477b6042f47b342539f3c9e6b00104 on catamphetamine:master.

catamphetamine commented 6 years ago

Hi. I googled MSISDN and didn't quite get the rules for constructing it. https://en.wikipedia.org/wiki/MSISDN

Not only there are at least two different standards (maybe more):

In GSM and its variant DCS 1800, MSISDN is built up as

In the GSM variant PCS 1900, MSISDN is built up as

But the rules for the standards themselves are also non-descriptive

MSISDN = CC + NDC + SN CC = Country Code NDC = National Destination Code, identifies one or part of a PLMN SN = Subscriber Number

While I know what CC means, they don't tell anything about what NDC and SN mean, for example.

I guess this is a complex topic requiring GSM expertise and I don't think we could pretend like having one. And also almost no one needs to format MSISDN numbers. E.164 - everyone. RFC URI - many people. MSISDN - almost no one.

catamphetamine commented 6 years ago

Can be closed now.