Upgrade to Pro — share decks privately, control downloads, hide ads and more …

電話番号を扱う技術

 電話番号を扱う技術

Shota Iguchi

October 21, 2017
Tweet

More Decks by Shota Iguchi

Other Decks in Technology

Transcript

  1. ి࿩൪߸Λѻ͏ٕज़ @iguchi1124

  2. ࿩͢͜ͱ ి࿩൪߸ΛWebαʔϏεͰར༻͢ΔͨΊʹߟྀ͢Δ͜ͱ ి࿩൪߸ύʔαʔͷ঺հ

  3. MFA (Multi Factor Authentication) ࿈བྷઌͷొ࿥ ϢʔβʔID ి࿩൪߸Λ࢖ͬͨΑ͋͘Δػೳ

  4. ໌Β͔ʹ͓͔͍͠஋ͷόϦσʔγϣϯ ࣮ࡍʹଘࡏ͠ಘΔి࿩൪߸͔Ͳ͏͔ w w w w w SMS͕ૹ৴Մೳ͔Ͳ͏͔ ೔ຊࠃ֎ͷܞଳి࿩Λ࢖͍ͬͯΔਓ΋͍Δ ి࿩൪߸ΛαʔϏεͰར༻͍ͨ͠

  5. ࠃࡍن֨ E164 ITU-T ͕ඪ४Խ͍ͯ͠Δి࿩൪߸ׂ౰ܭը ి࿩൪߸͕িಥ͠ͳ͍Α͏ʹ͢Δ࢓૊Έ ి࿩൪߸͸Ͳ͏΍ׂͬͯ౰ΒΕΔ͔

  6. ి࿩൪߸͸Ͳ͏΍ׂͬͯ౰ΒΕΔ͔ https://www.itu.int/rec/T-REC-E.164/

  7. ࣾձੑ࢓༷ ࠃ΍஍ҬͰి࿩൪߸͕িಥ͠ͳ͍Α͏ʹࠃ಺൪߸Λ࠾൪ ࠃ಺΍஍Ҭ͝ͱͰి࿩Λ͔͚ΔͨΊͷ࢓૊Έ ి࿩൪߸͸Ͳ͏΍ׂͬͯ౰ΒΕΔ͔

  8. Ϣʔβʔ͕ೝ͍ࣝͯ͠Δి࿩൪߸ͱ ਖ਼نԽ͞Εͨి࿩൪߸͸શ͘ผ෺ ϢʔβʔʹΑͬͯೖྗ͢Δ
 ి࿩൪߸ͷϑΥʔϚοτ͕ҧ͏ +

  9. ਖ਼نԽ͞Εͨࠃࡍి࿩൪߸ +81 80 XXXX XXXX Country code National number ࠃίʔυΛڞ༗͍ͯ͠Δࠃ಺ͰҰҙʹͳΔ

  10. Ϣʔβʔ͕ೝ͍ࣝͯ͠Δి࿩൪߸ 080 XXXX XXXX ࠃ಺Ͱి࿩΍SMSΛૹ৴͢Δͱ͖಄ʹ͚ͭΔ ࠃʹΑͬͯ࢓༷͕ҟͳΔ National prefix

  11. ֤ࠃͰ࠾༻͍ͯ͠Δࠃ಺ϓϨϑΟΫεͱࠃίʔυ ͦͷଞͷಠࣗͰ࠾༻͍ͯ͠Δ࢓༷ SMS͕ૹ৴Ͱ͖Δి࿩൪߸͔Ͳ͏͔ ϢʔβʔͷίϯςΩετ͕Θ͔Δ
 ݡ͍ύʔαʔ͕ඞཁ ి࿩൪߸ΛόϦσʔγϣϯ͢Δ

  12. ͦ͜Ͱ libphonenumber github.com/googlei18n/libphonenumber

  13. libphonenumberͷίί͕ੌ͍ Google͕ϝϯςφϯε͍ͯ͠Δి࿩൪߸ύʔαʔ ֤ࠃͷి࿩൪߸ͷಠࣗ࢓༷Λௐ΂ਚͨ͘͠࠷ڧͷϝλσʔλ
 Λ༻ҙ͍ͯ͠Δ ͋ΒΏΔݴޠͰѻ͑ΔΑ͏ʹͳ͍ͬͯΔ Javascript, Ruby, PHP, PostgreSQL, Go,

    C++Ͱར༻Ͱ͖Δ
  14. libphonenumberͷίί͕ੌ͍ TelephoneNumber.valid?('8180XXXXXXXX') # => true TelephoneNumber.valid?('+81 80 XXXX XXXX') #

    => true TelephoneNumber.valid?('080 XXXX XXXX', 'JP') # => true require 'telephone_number' telephone_number = TelephoneNumber.parse('8180XXXXXXXX') telephone_number.e164_number # => +8180XXXXXXXX telephone_number.national_number # => 080-XXXX-XXXX telephone_number.country.country_id # => JP telephone_number.valid_types # => [:mobile] github.com/mobi/telephone_number github.com/iguchi1124/global_phone_number ruby port library (WIP)
  15. ✅ ֤ࠃͰ࠾༻͍ͯ͠Δࠃ಺ϓϨϑΟΫεͱࠃίʔυ ✅ ͦͷଞͷಠࣗͰ࠾༻͍ͯ͠Δ࢓༷ ✅ SMS͕ૹ৴Ͱ͖Δి࿩൪߸͔Ͳ͏͔ ి࿩൪߸ΛόϦσʔγϣϯ͢Δ ࣮༻ஈ֊

  16. ͓ΘΓ