diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3bac377..4d0e188 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - ruby-version: [2.1.9, 2.2.10, 2.3.8, 2.4.6, 2.5.8, 2.6.6, 2.7.2, 3.0.1, jruby-9.1.17.0, jruby-9.2.17.0, truffleruby] + ruby-version: [2.6, 2.7, 3.0, 3.1, 3.2, jruby-9.4, truffleruby] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -22,4 +22,4 @@ jobs: run: bundle install - name: Run tests - run: bundle exec rake + run: bundle exec rspec diff --git a/CHANGELOG.md b/CHANGELOG.md index bc8f5c2..05f61b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## Next +## 0.2.0 - 2023-04-26 + +- [PR#9](https://github.com/tablecheck/paygate-ruby/pull/9) Rename Paygate::FormHelper to Paygate::Rails::FormHelper. ([johnnyshields](https://github.com/johnnyshields)) +- [PR#9](https://github.com/tablecheck/paygate-ruby/pull/9) Do not include Paygate::FormHelper in ActionView::Base. ([johnnyshields](https://github.com/johnnyshields)) +- [PR#9](https://github.com/tablecheck/paygate-ruby/pull/9) Update BIN list. Note BINs can now be a flexible number of digits. ([johnnyshields](https://github.com/johnnyshields)) +- [PR#9](https://github.com/tablecheck/paygate-ruby/pull/9) Rename data config YAML keys. ([johnnyshields](https://github.com/johnnyshields)) + ## 0.1.11 - 2022-05-13 - [PR#7](https://github.com/tablecheck/paygate-ruby/pull/7) Fix missed files in gem package. ([johnnyshields](https://github.com/johnnyshields)) diff --git a/Gemfile b/Gemfile index fa75df1..e121039 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,12 @@ source 'https://rubygems.org' +group :development, :test do + gem 'rake' +end + +group :test do + gem 'rspec' + gem 'timecop' +end + gemspec diff --git a/Rakefile b/Rakefile index 48ec749..c702cfc 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1 @@ require 'bundler/gem_tasks' - -task default: :spec diff --git a/data/card_bin_20191001.xlsx b/data/card_bin_20191001.xlsx deleted file mode 100644 index 9db13c1..0000000 Binary files a/data/card_bin_20191001.xlsx and /dev/null differ diff --git a/data/cdbn.20230401.unl.xlsx b/data/cdbn.20230401.unl.xlsx new file mode 100644 index 0000000..3675be3 Binary files /dev/null and b/data/cdbn.20230401.unl.xlsx differ diff --git a/data/config.yml b/data/config.yml index 135307e..845e6cb 100644 --- a/data/config.yml +++ b/data/config.yml @@ -7,2738 +7,3341 @@ ja: 'JP' zh-CN: 'CN' -:intl: - :brands: - :visa: '2Z0' - :mastercard: '2Y0' - :jcb: '2J0' - :amex: '2A0' +:intl_brands: + :visa: '2Z0' + :mastercard: '2Y0' + :jcb: '2J0' + :amex: '2A0' -:korea: - :bin_numbers: # from here: https://ksnet.co.kr/Bbs/Details/?id=2478&ci=NOTICE&c=NOTICE&f=ALL&q=bin - - '000110' - - '000111' - - '000112' - - '000113' - - '000114' - - '000115' - - '000116' - - '000117' - - '000118' - - '000119' - - '000120' - - '000121' - - '000122' - - '000123' - - '000124' - - '000125' - - '000126' - - '000127' - - '000128' - - '000129' - - '000130' - - '000131' - - '000132' - - '000133' - - '000134' - - '000135' - - '000136' - - '000137' - - '000138' - - '000139' - - '000140' - - '000141' - - '000142' - - '000143' - - '000144' - - '000145' - - '000146' - - '000147' - - '000148' - - '000149' - - '000150' - - '000151' - - '000152' - - '000153' - - '000154' - - '000155' - - '000156' - - '000157' - - '000158' - - '000159' - - '000190' - - '000191' - - '000192' - - '000193' - - '000194' - - '000195' - - '000196' - - '000197' - - '000198' - - '000199' - - '000210' - - '000211' - - '000212' - - '000213' - - '000214' - - '000215' - - '000216' - - '000217' - - '000218' - - '000219' - - '000220' - - '000221' - - '000222' - - '000223' - - '000224' - - '000225' - - '000226' - - '000227' - - '000228' - - '000229' - - '000230' - - '000231' - - '000232' - - '000233' - - '000234' - - '000235' - - '000236' - - '000237' - - '000238' - - '000239' - - '000240' - - '000241' - - '000242' - - '000243' - - '000244' - - '000245' - - '000246' - - '000247' - - '000248' - - '000249' - - '000250' - - '000251' - - '000252' - - '000253' - - '000254' - - '000255' - - '000256' - - '000257' - - '000258' - - '000259' - - '000510' - - '000511' - - '000512' - - '000513' - - '000514' - - '000515' - - '000516' - - '000517' - - '000518' - - '000519' - - '000520' - - '000521' - - '000522' - - '000523' - - '000524' - - '000525' - - '000526' - - '000527' - - '000528' - - '000529' - - '000530' - - '000531' - - '000532' - - '000533' - - '000534' - - '000535' - - '000536' - - '000537' - - '000538' - - '000539' - - '000540' - - '000541' - - '000542' - - '000543' - - '000544' - - '000545' - - '000546' - - '000547' - - '000548' - - '000549' - - '000550' - - '000551' - - '000552' - - '000553' - - '000554' - - '000555' - - '000556' - - '000557' - - '000558' - - '000559' - - '209304' - - '222884' - - '356003' - - '356006' - - '356011' - - '356012' - - '356020' - - '356021' - - '356022' - - '356023' - - '356024' - - '356025' - - '356027' - - '356031' - - '356032' - - '356033' - - '356036' - - '356039' - - '356078' - - '356087' - - '356234' - - '356283' - - '356290' - - '356291' - - '356292' - - '356293' - - '356294' - - '356295' - - '356296' - - '356297' - - '356298' - - '356303' - - '356306' - - '356311' - - '356312' - - '356316' - - '356317' - - '356320' - - '356321' - - '356322' - - '356323' - - '356324' - - '356325' - - '356327' - - '356331' - - '356332' - - '356333' - - '356336' - - '356339' - - '356406' - - '356407' - - '356413' - - '356414' - - '356415' - - '356416' - - '356417' - - '356454' - - '356478' - - '356479' - - '356503' - - '356506' - - '356511' - - '356512' - - '356516' - - '356517' - - '356520' - - '356521' - - '356522' - - '356523' - - '356525' - - '356527' - - '356531' - - '356532' - - '356533' - - '356534' - - '356539' - - '356543' - - '356544' - - '356545' - - '356716' - - '356717' - - '356800' - - '356801' - - '356802' - - '356803' - - '356820' - - '356823' - - '356824' - - '356878' - - '356891' - - '356892' - - '356900' - - '356901' - - '356902' - - '356904' - - '356905' - - '356906' - - '356907' - - '356908' - - '356910' - - '356911' - - '356912' - - '356914' - - '356915' - - '356916' - - '356920' - - '356932' - - '356978' - - '356979' - - '357104' - - '357116' - - '357117' - - '357118' - - '357119' - - '360043' - - '360069' - - '361246' - - '361247' - - '361248' - - '361650' - - '361651' - - '361652' - - '361653' - - '361654' - - '364124' - - '364125' - - '364178' - - '364445' - - '364681' - - '364682' - - '364683' - - '364828' - - '364829' - - '364830' - - '365405' - - '365431' - - '365573' - - '365574' - - '365645' - - '365646' - - '371001' - - '371002' - - '371003' - - '374722' - - '374723' - - '374724' - - '374725' - - '375144' - - '376250' - - '376251' - - '376252' - - '376253' - - '376254' - - '376255' - - '376256' - - '376257' - - '376258' - - '376259' - - '376260' - - '376261' - - '376262' - - '376263' - - '376264' - - '376265' - - '376266' - - '376267' - - '376268' - - '376269' - - '376270' - - '376271' - - '376272' - - '376273' - - '376274' - - '376275' - - '376276' - - '376277' - - '376278' - - '376279' - - '376290' - - '376291' - - '376292' - - '376293' - - '376364' - - '376365' - - '377177' - - '377178' - - '377345' - - '377346' - - '377966' - - '377969' - - '377973' - - '377981' - - '377982' - - '377983' - - '377985' - - '377988' - - '377989' - - '377990' - - '377991' - - '377992' - - '377993' - - '377994' - - '377995' - - '377996' - - '377997' - - '377998' - - '377999' - - '379183' - - '379184' - - '379192' - - '379193' - - '379194' - - '379220' - - '379348' - - '379349' - - '379350' - - '379351' - - '379909' - - '379910' - - '379971' - - '400124' - - '400223' - - '400278' - - '400558' - - '400569' - - '400904' - - '400905' - - '400906' - - '400907' - - '400911' - - '400912' - - '400913' - - '400933' - - '400978' - - '401120' - - '401278' - - '401320' - - '401584' - - '401585' - - '401678' - - '401762' - - '401787' - - '401844' - - '401895' - - '402017' - - '402072' - - '402175' - - '402359' - - '402367' - - '402502' - - '402515' - - '402516' - - '402517' - - '402596' - - '402822' - - '402857' - - '402858' - - '402859' - - '402860' - - '403011' - - '403012' - - '403293' - - '403302' - - '403346' - - '403803' - - '403806' - - '403811' - - '403812' - - '403820' - - '403821' - - '403823' - - '403827' - - '403831' - - '403832' - - '403839' - - '403878' - - '404331' - - '404332' - - '404336' - - '404339' - - '404611' - - '404612' - - '404678' - - '404720' - - '404726' - - '404727' - - '404728' - - '404803' - - '404806' - - '404811' - - '404812' - - '404820' - - '404821' - - '404822' - - '404823' - - '404824' - - '404825' - - '404827' - - '404933' - - '404947' - - '405203' - - '405207' - - '405220' - - '405331' - - '405432' - - '405665' - - '405753' - - '406078' - - '406107' - - '406158' - - '406357' - - '406703' - - '406706' - - '406711' - - '406712' - - '406720' - - '406721' - - '406723' - - '406725' - - '406727' - - '406731' - - '406732' - - '406733' - - '406739' - - '406745' - - '407424' - - '407503' - - '407541' - - '407558' - - '407589' - - '407590' - - '407603' - - '407625' - - '407725' - - '407785' - - '407916' - - '407917' - - '408320' - - '408511' - - '408512' - - '408539' - - '408907' - - '408966' - - '409085' - - '409216' - - '409217' - - '409231' - - '409232' - - '409460' - - '410109' - - '410120' - - '410278' - - '410378' - - '411133' - - '411178' - - '411471' - - '411478' - - '411825' - - '411896' - - '411897' - - '411904' - - '411905' - - '412020' - - '412994' - - '413526' - - '413700' - - '413720' - - '413780' - - '413837' - - '414003' - - '414006' - - '414011' - - '414012' - - '414020' - - '414021' - - '414022' - - '414023' - - '414024' - - '414025' - - '414027' - - '414031' - - '414032' - - '414036' - - '414039' - - '414296' - - '414520' - - '414625' - - '414710' - - '414743' - - '414744' - - '414749' - - '415525' - - '416206' - - '416207' - - '416237' - - '416324' - - '416332' - - '416339' - - '417103' - - '417233' - - '417256' - - '417920' - - '418143' - - '418163' - - '418164' - - '418173' - - '418236' - - '418237' - - '419696' - - '419697' - - '419698' - - '419699' - - '419803' - - '420178' - - '420189' - - '420190' - - '420701' - - '420707' - - '420920' - - '421103' - - '421106' - - '421111' - - '421112' - - '421120' - - '421121' - - '421123' - - '421127' - - '421131' - - '421132' - - '421134' - - '421139' - - '421403' - - '421406' - - '421411' - - '421417' - - '421418' - - '421420' - - '421421' - - '421423' - - '421425' - - '421427' - - '421431' - - '421432' - - '421439' - - '421468' - - '421573' - - '421607' - - '421685' - - '421733' - - '421820' - - '421834' - - '422015' - - '422016' - - '422018' - - '422155' - - '422190' - - '422715' - - '422717' - - '422727' - - '423950' - - '425863' - - '425920' - - '426066' - - '426578' - - '426586' - - '426589' - - '426907' - - '426920' - - '427120' - - '427203' - - '427206' - - '427220' - - '427221' - - '427223' - - '427227' - - '427231' - - '427232' - - '427239' - - '427329' - - '427352' - - '427386' - - '428411' - - '428412' - - '428431' - - '428432' - - '428439' - - '428465' - - '428696' - - '428697' - - '428908' - - '428909' - - '428920' - - '429212' - - '429498' - - '429499' - - '429612' - - '430603' - - '430969' - - '430972' - - '430984' - - '432445' - - '432627' - - '432632' - - '432768' - - '433010' - - '433028' - - '433087' - - '433290' - - '433521' - - '433692' - - '433693' - - '434346' - - '434347' - - '434976' - - '435661' - - '436417' - - '436420' - - '436422' - - '436477' - - '436511' - - '436550' - - '437368' - - '437432' - - '437436' - - '437437' - - '437438' - - '437719' - - '438265' - - '438654' - - '438674' - - '438676' - - '438922' - - '439110' - - '440025' - - '440445' - - '440446' - - '440447' - - '440448' - - '442660' - - '443567' - - '443569' - - '443579' - - '445056' - - '445090' - - '445096' - - '447320' - - '447703' - - '447781' - - '447820' - - '448103' - - '448106' - - '448108' - - '448111' - - '448112' - - '448121' - - '448122' - - '448123' - - '448124' - - '448125' - - '448127' - - '448131' - - '448132' - - '448133' - - '448135' - - '448139' - - '448143' - - '448168' - - '448492' - - '448494' - - '448523' - - '448537' - - '448550' - - '448555' - - '449914' - - '450025' - - '450203' - - '450520' - - '450596' - - '451099' - - '451101' - - '451245' - - '451279' - - '451281' - - '451842' - - '451843' - - '451844' - - '451845' - - '451846' - - '452013' - - '452373' - - '453123' - - '453261' - - '453934' - - '453936' - - '454303' - - '454478' - - '455303' - - '455306' - - '455311' - - '455312' - - '455320' - - '455321' - - '455322' - - '455323' - - '455324' - - '455325' - - '455327' - - '455331' - - '455332' - - '455336' - - '455339' - - '455420' - - '455437' - - '456037' - - '456058' - - '456702' - - '456703' - - '457047' - - '457048' - - '457318' - - '457492' - - '457493' - - '457972' - - '457973' - - '458484' - - '458525' - - '458532' - - '458568' - - '458857' - - '459222' - - '459855' - - '459856' - - '459857' - - '459858' - - '459859' - - '459860' - - '459900' - - '459901' - - '459902' - - '459903' - - '459904' - - '459906' - - '459912' - - '459930' - - '459931' - - '459936' - - '459950' - - '459951' - - '459952' - - '459953' - - '460561' - - '461723' - - '461724' - - '461771' - - '461774' - - '461775' - - '461781' - - '461954' - - '461980' - - '462890' - - '463235' - - '463732' - - '463915' - - '463916' - - '464022' - - '464092' - - '464562' - - '464637' - - '464647' - - '464942' - - '464955' - - '464959' - - '464960' - - '464965' - - '465306' - - '465518' - - '465521' - - '465522' - - '465523' - - '465524' - - '465583' - - '465613' - - '465887' - - '465888' - - '465889' - - '466571' - - '467006' - - '467007' - - '467008' - - '467009' - - '467069' - - '467077' - - '467119' - - '467120' - - '467121' - - '467122' - - '467123' - - '467309' - - '467963' - - '468780' - - '468781' - - '468782' - - '468908' - - '468909' - - '468911' - - '469536' - - '469537' - - '469631' - - '469632' - - '469639' - - '470399' - - '470547' - - '470587' - - '470588' - - '470616' - - '470617' - - '470618' - - '470630' - - '470631' - - '472175' - - '472200' - - '472246' - - '472263' - - '472264' - - '472429' - - '472632' - - '472637' - - '472650' - - '473058' - - '473059' - - '473844' - - '473867' - - '474289' - - '474290' - - '474360' - - '474361' - - '474420' - - '474523' - - '474524' - - '474606' - - '474607' - - '474608' - - '474817' - - '475503' - - '475506' - - '475511' - - '475512' - - '475520' - - '475521' - - '475522' - - '475523' - - '475524' - - '475525' - - '475527' - - '475531' - - '475532' - - '475536' - - '475539' - - '476020' - - '476021' - - '476063' - - '478892' - - '479588' - - '479589' - - '480074' - - '480400' - - '480417' - - '480422' - - '480434' - - '480443' - - '480444' - - '480450' - - '480451' - - '483543' - - '483544' - - '483578' - - '483592' - - '483632' - - '483639' - - '483735' - - '483736' - - '483792' - - '483793' - - '484087' - - '484809' - - '485475' - - '485476' - - '485477' - - '485478' - - '485479' - - '485480' - - '485492' - - '485493' - - '485903' - - '485906' - - '485920' - - '485927' - - '486467' - - '486468' - - '486469' - - '486475' - - '486578' - - '486579' - - '486678' - - '486679' - - '488906' - - '488919' - - '488920' - - '488921' - - '488972' - - '489010' - - '489515' - - '489904' - - '490011' - - '490012' - - '490020' - - '490220' - - '490274' - - '490298' - - '490603' - - '490606' - - '490611' - - '490612' - - '490620' - - '490621' - - '490622' - - '490623' - - '490624' - - '490625' - - '490627' - - '490631' - - '490632' - - '490636' - - '490639' - - '491217' - - '491218' - - '492511' - - '492512' - - '493455' - - '496603' - - '498411' - - '498412' - - '498737' - - '498819' - - '498820' - - '502123' - - '502928' - - '510003' - - '510554' - - '510737' - - '511187' - - '511845' - - '512028' - - '512114' - - '512351' - - '512352' - - '512353' - - '512354' - - '512355' - - '512359' - - '512365' - - '512462' - - '512609' - - '512635' - - '512813' - - '512830' - - '513041' - - '513243' - - '513480' - - '513791' - - '513792' - - '513893' - - '513894' - - '513895' - - '514043' - - '514473' - - '514564' - - '514645' - - '514876' - - '515193' - - '515197' - - '515408' - - '515594' - - '515606' - - '515708' - - '515954' - - '516006' - - '516078' - - '516191' - - '516341' - - '516411' - - '516450' - - '516453' - - '516526' - - '516574' - - '516695' - - '517134' - - '517220' - - '517548' - - '517560' - - '517662' - - '517709' - - '517827' - - '518135' - - '518185' - - '518283' - - '518319' - - '518420' - - '518432' - - '518669' - - '518831' - - '518928' - - '518929' - - '518930' - - '519157' - - '519303' - - '519335' - - '519635' - - '519657' - - '519718' - - '519751' - - '519892' - - '520025' - - '520045' - - '520421' - - '520422' - - '520504' - - '520613' - - '520667' - - '521126' - - '521135' - - '521176' - - '521186' - - '521189' - - '521717' - - '521718' - - '522051' - - '522111' - - '522112' - - '522114' - - '522115' - - '522119' - - '522123' - - '522124' - - '522125' - - '522129' - - '522447' - - '522509' - - '522802' - - '522855' - - '522894' - - '522971' - - '523401' - - '523402' - - '523410' - - '523424' - - '523521' - - '523527' - - '523612' - - '523651' - - '523830' - - '523930' - - '524012' - - '524013' - - '524014' - - '524015' - - '524019' - - '524021' - - '524022' - - '524023' - - '524024' - - '524025' - - '524028' - - '524029' - - '524041' - - '524140' - - '524141' - - '524144' - - '524180' - - '524220' - - '524223' - - '524225' - - '524226' - - '524242' - - '524285' - - '524333' - - '524335' - - '524531' - - '524603' - - '524713' - - '525316' - - '525549' - - '525783' - - '525982' - - '525989' - - '526251' - - '526373' - - '526878' - - '527182' - - '527257' - - '527289' - - '527419' - - '527810' - - '528054' - - '528268' - - '528274' - - '528523' - - '528638' - - '528664' - - '528665' - - '528936' - - '528937' - - '528949' - - '528951' - - '529014' - - '529269' - - '529281' - - '529803' - - '529875' - - '529877' - - '529899' - - '530369' - - '530432' - - '531070' - - '531072' - - '531080' - - '531082' - - '531085' - - '531088' - - '531194' - - '531408' - - '531838' - - '532092' - - '532105' - - '532147' - - '532188' - - '532288' - - '532444' - - '532793' - - '532799' - - '532913' - - '533014' - - '533032' - - '533337' - - '533349' - - '533427' - - '533774' - - '533827' - - '533872' - - '534132' - - '534291' - - '534292' - - '534553' - - '535020' - - '535052' - - '535180' - - '536125' - - '536142' - - '536148' - - '536181' - - '536320' - - '536323' - - '536326' - - '536460' - - '536510' - - '536539' - - '536617' - - '536623' - - '536624' - - '536648' - - '536683' - - '536802' - - '536883' - - '536945' - - '536946' - - '536984' - - '537042' - - '537044' - - '537102' - - '537120' - - '537145' - - '537614' - - '537620' - - '537659' - - '537662' - - '537692' - - '537703' - - '537706' - - '537711' - - '537712' - - '537720' - - '537723' - - '537725' - - '537727' - - '537731' - - '537732' - - '537736' - - '537739' - - '537943' - - '537952' - - '538003' - - '538159' - - '538165' - - '538179' - - '538720' - - '538803' - - '538806' - - '538811' - - '538812' - - '538820' - - '538823' - - '538825' - - '538827' - - '538831' - - '538832' - - '538836' - - '538839' - - '538903' - - '538920' - - '539030' - - '540388' - - '540447' - - '540486' - - '540497' - - '540528' - - '540537' - - '540538' - - '540554' - - '540591' - - '540689' - - '540799' - - '540926' - - '540947' - - '541145' - - '541259' - - '541633' - - '541707' - - '541721' - - '541757' - - '542158' - - '542184' - - '542220' - - '542265' - - '542416' - - '542448' - - '542564' - - '542586' - - '542720' - - '542879' - - '543017' - - '543241' - - '543333' - - '543341' - - '543617' - - '544004' - - '544082' - - '544120' - - '544167' - - '544174' - - '544203' - - '545089' - - '546111' - - '546112' - - '546252' - - '546418' - - '546465' - - '546596' - - '547109' - - '547149' - - '547227' - - '547609' - - '547671' - - '547924' - - '548020' - - '548213' - - '548238' - - '548596' - - '548732' - - '548781' - - '548811' - - '548816' - - '548818' - - '548841' - - '548869' - - '548870' - - '549029' - - '549153' - - '549155' - - '549594' - - '549840' - - '549861' - - '550744' - - '551431' - - '552014' - - '552051' - - '552052' - - '552087' - - '552103' - - '552106' - - '552111' - - '552112' - - '552120' - - '552122' - - '552123' - - '552124' - - '552125' - - '552131' - - '552132' - - '552133' - - '552136' - - '552139' - - '552164' - - '552194' - - '552220' - - '552248' - - '552290' - - '552323' - - '552376' - - '552377' - - '552386' - - '552387' - - '552407' - - '552412' - - '552423' - - '552432' - - '552441' - - '552445' - - '552521' - - '552532' - - '552537' - - '552576' - - '552803' - - '552806' - - '552811' - - '552812' - - '552823' - - '552920' - - '553078' - - '553109' - - '553142' - - '553144' - - '553146' - - '553147' - - '553150' - - '553151' - - '553152' - - '553155' - - '553159' - - '553168' - - '553169' - - '553171' - - '553172' - - '553173' - - '553176' - - '553177' - - '553178' - - '553179' - - '553180' - - '553181' - - '553184' - - '553190' - - '553208' - - '553211' - - '553212' - - '553213' - - '553214' - - '553219' - - '553220' - - '553221' - - '553224' - - '553225' - - '553406' - - '553423' - - '553531' - - '553615' - - '553727' - - '553820' - - '554049' - - '554345' - - '554349' - - '554382' - - '554481' - - '554578' - - '554620' - - '554648' - - '554921' - - '554959' - - '555023' - - '555111' - - '555112' - - '555120' - - '555121' - - '555131' - - '555132' - - '555133' - - '555139' - - '555870' - - '555904' - - '555916' - - '556608' - - '556659' - - '556678' - - '557042' - - '557889' - - '558370' - - '558420' - - '558453' - - '558503' - - '558506' - - '558511' - - '558512' - - '558520' - - '558521' - - '558523' - - '558524' - - '558525' - - '558526' - - '558527' - - '558531' - - '558532' - - '558536' - - '558539' - - '558735' - - '558738' - - '558749' - - '558768' - - '558817' - - '558822' - - '558875' - - '558881' - - '558885' - - '558903' - - '558906' - - '558911' - - '558912' - - '558914' - - '558915' - - '558917' - - '558920' - - '558921' - - '558922' - - '558923' - - '558924' - - '558925' - - '558927' - - '558931' - - '558932' - - '558933' - - '558939' - - '558950' - - '558953' - - '558961' - - '558970' - - '558971' - - '558972' - - '558975' - - '558976' - - '558978' - - '559084' - - '559123' - - '559246' - - '559293' - - '559329' - - '559410' - - '559434' - - '559438' - - '559571' - - '559588' - - '559620' - - '559631' - - '559632' - - '559639' - - '559794' - - '559869' - - '559913' - - '559924' - - '559957' - - '559962' - - '604823' - - '605615' - - '606045' - - '606052' - - '620011' - - '620027' - - '620031' - - '620039' - - '620103' - - '620106' - - '620120' - - '620123' - - '620125' - - '620132' - - '620220' - - '620278' - - '620812' - - '621003' - - '621006' - - '621011' - - '621012' - - '621020' - - '621023' - - '621025' - - '621027' - - '621031' - - '621032' - - '621039' - - '621051' - - '621078' - - '621079' - - '621220' - - '621249' - - '621484' - - '621639' - - '621640' - - '621641' - - '623024' - - '623322' - - '623323' - - '623329' - - '623340' - - '623341' - - '623358' - - '623374' - - '623379' - - '623387' - - '623390' - - '623391' - - '623392' - - '623393' - - '623394' - - '623395' - - '623451' - - '623452' - - '623453' - - '623454' - - '623470' - - '623489' - - '624313' - - '624320' - - '624321' - - '624324' - - '624325' - - '624331' - - '624332' - - '624333' - - '624335' - - '624336' - - '624339' - - '624343' - - '624344' - - '624345' - - '624346' - - '624348' - - '624349' - - '624350' - - '624358' - - '624359' - - '624360' - - '624361' - - '624362' - - '624363' - - '624368' - - '624370' - - '624373' - - '624374' - - '624375' - - '624376' - - '624377' - - '624378' - - '624379' - - '624380' - - '624381' - - '624382' - - '624383' - - '624384' - - '624387' - - '624388' - - '624389' - - '624399' - - '624400' - - '624401' - - '624404' - - '624410' - - '624411' - - '624414' - - '624420' - - '624424' - - '624432' - - '624434' - - '624435' - - '624436' - - '624437' - - '624440' - - '624441' - - '624442' - - '624443' - - '624444' - - '624446' - - '624448' - - '624449' - - '624450' - - '624451' - - '624452' - - '624462' - - '624479' - - '624480' - - '624482' - - '625003' - - '625006' - - '625011' - - '625012' - - '625020' - - '625023' - - '625025' - - '625027' - - '625031' - - '625032' - - '625039' - - '625078' - - '625079' - - '625103' - - '625106' - - '625111' - - '625112' - - '625120' - - '625123' - - '625125' - - '625127' - - '625131' - - '625132' - - '625139' - - '625178' - - '625179' - - '625220' - - '625241' - - '625242' - - '625243' - - '625244' - - '625245' - - '625246' - - '625320' - - '625804' - - '625814' - - '625817' - - '625840' - - '625841' - - '625904' - - '626222' - - '626236' - - '626237' - - '626250' - - '626251' - - '626261' - - '626275' - - '626277' - - '626344' - - '626399' - - '626400' - - '626402' - - '626409' - - '626415' - - '626416' - - '626422' - - '626426' - - '628180' - - '629141' - - '636078' - - '636093' - - '636094' - - '636095' - - '636189' - - '639339' - - '639578' - - '639650' - - '654103' - - '654106' - - '654111' - - '654112' - - '654115' - - '654116' - - '654117' - - '654120' - - '654123' - - '654125' - - '654127' - - '654131' - - '654132' - - '654133' - - '654139' - - '654150' - - '654203' - - '654206' - - '654211' - - '654212' - - '654215' - - '654220' - - '654223' - - '654225' - - '654227' - - '654231' - - '654232' - - '654239' - - '654250' - - '655603' - - '655606' - - '655611' - - '655612' - - '655614' - - '655615' - - '655616' - - '655617' - - '655618' - - '655620' - - '655623' - - '655625' - - '655627' - - '655631' - - '655632' - - '655633' - - '655639' - - '655650' - - '655803' - - '655806' - - '655811' - - '655812' - - '655814' - - '655815' - - '655816' - - '655817' - - '655818' - - '655820' - - '655823' - - '655825' - - '655827' - - '655831' - - '655832' - - '655839' - - '655850' - - '655916' - - '655918' - - '655920' - - '657016' - - '657018' - - '657020' - - '657031' - - '657032' - - '657039' - - '657303' - - '657306' - - '657311' - - '657312' - - '657313' - - '657314' - - '657315' - - '657316' - - '657317' - - '657318' - - '657320' - - '657323' - - '657325' - - '657327' - - '657331' - - '657332' - - '657333' - - '657339' - - '657350' - - '700100' - - '700101' - - '700105' - - '700106' - - '700107' - - '700109' - - '700116' - - '700117' - - '700126' - - '700127' - - '720002' - - '720031' - - '720032' - - '720033' - - '720041' - - '720042' - - '720043' - - '720044' - - '720051' - - '720052' - - '720053' - - '720054' - - '720055' - - '720061' - - '720062' - - '720063' - - '720064' - - '834000' - - '834024' - - '834026' - - '871001' - - '881001' - - '900001' - - '900050' - - '900101' - - '903501' - - '903502' - - '903503' - - '903504' - - '903505' - - '903516' - - '903517' - - '903518' - - '903519' - - '903520' - - '903551' - - '903552' - - '903553' - - '903554' - - '903555' - - '910003' - - '910006' - - '910007' - - '910011' - - '910012' - - '910020' - - '910021' - - '910023' - - '910025' - - '910027' - - '910031' - - '910032' - - '910034' - - '910035' - - '910036' - - '910037' - - '910039' - - '910050' - - '910120' - - '910150' - - '920002' - - '920003' - - '920006' - - '920007' - - '920009' - - '920011' - - '920012' - - '920013' - - '920014' - - '920018' - - '920020' - - '920021' - - '920023' - - '920025' - - '920027' - - '920030' - - '920031' - - '920032' - - '920034' - - '920035' - - '920036' - - '920037' - - '920039' - - '920042' - - '920045' - - '920048' - - '920050' - - '920059' - - '920061' - - '920063' - - '920064' - - '920071' - - '920079' - - '920080' - - '920091' - - '920092' - - '920095' - - '920096' - - '920120' - - '920215' - - '920232' - - '920239' - - '920315' - - '920432' - - '920439' - - '930003' - - '930007' - - '930011' - - '930020' - - '930023' - - '930031' - - '930032' - - '930034' - - '930037' - - '930039' - - '930050' - - '930103' - - '930111' - - '930112' - - '930123' - - '930125' - - '930131' - - '930132' - - '930139' - - '930144' - - '935003' - - '935007' - - '935016' - - '935017' - - '935020' - - '935023' - - '935031' - - '935032' - - '935034' - - '935037' - - '935039' - - '935071' - - '940010' - - '940011' - - '940012' - - '940017' - - '940020' - - '940030' - - '940040' - - '940050' - - '940060' - - '940070' - - '940327' - - '940388' - - '940701' - - '940702' - - '940703' - - '940704' - - '940706' - - '940707' - - '940708' - - '940910' - - '940911' - - '940912' - - '940913' - - '940914' - - '940915' - - '940916' - - '940917' - - '940918' - - '940919' - - '940920' - - '940921' - - '940922' - - '940923' - - '940924' - - '940925' - - '940926' - - '940927' - - '940928' - - '940929' - - '940930' - - '940931' - - '940932' - - '940933' - - '940934' - - '940935' - - '940936' - - '940937' - - '940938' - - '940939' - - '940940' - - '940941' - - '940942' - - '940943' - - '940945' - - '940947' - - '940948' - - '940949' - - '940951' - - '940952' - - '940953' - - '940955' - - '940956' - - '940957' - - '940958' - - '940960' - - '940961' - - '940962' - - '940963' - - '940964' - - '940965' - - '940966' - - '940967' - - '940968' - - '940969' - - '940970' - - '940971' - - '940972' - - '940973' - - '940974' - - '940975' - - '940976' - - '940977' - - '940978' - - '940979' - - '940980' - - '940981' - - '940982' - - '940983' - - '940991' - - '940999' - - '941000' - - '941001' - - '941002' - - '941003' - - '941004' - - '941005' - - '941006' - - '941008' - - '941009' - - '941010' - - '941011' - - '941012' - - '941013' - - '941014' - - '941015' - - '941017' - - '941018' - - '941019' - - '941020' - - '941021' - - '941022' - - '941023' - - '941024' - - '941025' - - '941026' - - '941027' - - '941028' - - '941029' - - '941030' - - '941031' - - '941032' - - '941034' - - '941035' - - '941036' - - '941037' - - '941038' - - '941039' - - '941044' - - '941049' - - '941050' - - '941051' - - '941052' - - '941053' - - '941056' - - '941057' - - '941058' - - '941059' - - '941060' - - '941061' - - '941062' - - '941063' - - '941064' - - '941065' - - '941066' - - '941067' - - '941068' - - '941069' - - '941071' - - '941073' - - '941074' - - '941075' - - '941076' - - '941077' - - '941078' - - '941080' - - '941081' - - '941082' - - '941083' - - '941084' - - '941085' - - '941086' - - '941088' - - '941089' - - '941090' - - '941091' - - '941092' - - '941093' - - '941094' - - '941095' - - '941096' - - '941097' - - '941098' - - '941099' - - '941111' - - '941112' - - '941116' - - '941117' - - '941120' - - '941161' - - '941177' - - '941178' - - '941179' - - '941181' - - '941194' - - '941195' - - '941199' - - '941281' - - '941381' - - '941520' - - '941581' - - '941607' - - '941620' - - '941623' - - '941631' - - '941632' - - '941634' - - '941635' - - '941636' - - '941637' - - '941639' - - '941642' - - '941643' - - '941645' - - '941648' - - '941650' - - '941671' - - '941681' - - '941691' - - '941696' - - '941707' - - '941711' - - '941712' - - '941722' - - '941723' - - '941724' - - '941725' - - '941731' - - '941732' - - '941734' - - '941735' - - '941736' - - '941737' - - '941739' - - '941750' - - '941781' - - '941807' - - '941881' - - '941981' - - '942003' - - '942006' - - '942011' - - '942012' - - '942018' - - '942019' - - '942020' - - '942021' - - '942022' - - '942023' - - '942024' - - '942025' - - '942027' - - '942031' - - '942032' - - '942034' - - '942035' - - '942036' - - '942039' - - '942061' - - '942062' - - '942063' - - '942064' - - '942065' - - '942069' - - '942070' - - '942072' - - '942073' - - '942074' - - '942075' - - '942076' - - '942077' - - '942078' - - '942081' - - '942082' - - '942083' - - '942084' - - '942085' - - '942086' - - '942087' - - '942088' - - '942089' - - '942090' - - '942091' - - '942092' - - '942093' - - '942094' - - '942095' - - '942096' - - '942099' - - '942101' - - '942120' - - '942122' - - '942124' - - '942132' - - '942150' - - '942203' - - '942239' - - '942520' - - '942522' - - '942524' - - '942620' - - '942720' - - '942820' - - '943003' - - '943006' - - '943011' - - '943012' - - '943016' - - '943017' - - '943020' - - '943021' - - '943022' - - '943023' - - '943024' - - '943025' - - '943027' - - '943031' - - '943032' - - '943034' - - '943036' - - '943039' - - '943050' - - '943062' - - '943078' - - '943081' - - '943116' - - '943117' - - '943132' - - '943133' - - '943134' - - '943135' - - '943137' - - '943150' - - '943181' - - '943210' - - '943211' - - '943212' - - '943213' - - '943214' - - '943215' - - '943216' - - '943281' - - '943381' - - '943416' - - '943417' - - '943481' - - '943520' - - '943543' - - '943544' - - '943581' - - '943645' - - '943646' - - '943648' - - '943649' - - '943907' - - '943920' - - '943921' - - '943924' - - '943925' - - '943978' - - '944002' - - '944003' - - '944006' - - '944007' - - '944009' - - '944011' - - '944012' - - '944018' - - '944020' - - '944021' - - '944022' - - '944023' - - '944025' - - '944027' - - '944030' - - '944031' - - '944032' - - '944039' - - '944043' - - '944045' - - '944048' - - '944061' - - '944063' - - '944064' - - '944071' - - '944078' - - '944079' - - '944080' - - '944081' - - '944095' - - '944096' - - '944103' - - '944111' - - '944112' - - '944116' - - '944117' - - '944120' - - '944122' - - '944124' - - '944131' - - '944132' - - '944137' - - '944139' - - '944181' - - '944192' - - '944203' - - '944222' - - '944224' - - '944281' - - '944303' - - '944306' - - '944307' - - '944311' - - '944312' - - '944320' - - '944322' - - '944324' - - '944331' - - '944334' - - '944337' - - '944350' - - '944403' - - '944420' - - '944431' - - '944443' - - '944520' - - '944522' - - '944524' - - '944541' - - '944542' - - '944543' - - '944545' - - '944546' - - '944547' - - '944548' - - '944549' - - '944550' - - '944551' - - '944552' - - '944603' - - '944620' - - '944622' - - '944624' - - '944631' - - '944664' - - '944691' - - '944696' - - '944703' - - '944707' - - '944720' - - '944920' - - '944934' - - '944948' - - '944949' - - '944950' - - '945003' - - '945006' - - '945007' - - '945011' - - '945012' - - '945020' - - '945021' - - '945023' - - '945025' - - '945027' - - '945031' - - '945032' - - '945033' - - '945034' - - '945035' - - '945037' - - '945039' - - '945078' - - '945081' - - '945103' - - '945107' - - '945111' - - '945112' - - '945120' - - '945131' - - '945132' - - '945150' - - '945161' - - '945162' - - '945203' - - '945211' - - '945212' - - '945220' - - '945320' - - '945324' - - '945420' - - '945511' - - '945520' - - '945620' - - '945720' - - '945810' - - '945811' - - '945812' - - '945813' - - '945814' - - '945815' - - '945816' - - '945817' - - '945818' - - '945819' - - '945820' - - '945821' - - '945822' - - '945823' - - '945824' - - '945825' - - '945903' - - '945920' - - '945934' - - '945937' - - '946003' - - '946006' - - '946007' - - '946011' - - '946012' - - '946020' - - '946021' - - '946023' - - '946025' - - '946027' - - '946031' - - '946032' - - '946033' - - '946034' - - '946039' - - '946044' - - '946046' - - '946050' - - '946078' - - '946081' - - '946103' - - '946106' - - '946111' - - '946112' - - '946116' - - '946117' - - '946120' - - '946121' - - '946123' - - '946124' - - '946127' - - '946131' - - '946132' - - '946134' - - '946137' - - '946139' - - '946144' - - '946150' - - '946178' - - '946181' - - '946216' - - '946217' - - '946220' - - '946250' - - '946316' - - '946317' - - '946320' - - '946350' - - '946403' - - '946406' - - '946411' - - '946412' - - '946420' - - '946423' - - '946427' - - '946431' - - '946432' - - '946439' - - '946450' - - '946478' - - '946503' - - '946511' - - '946512' - - '946513' - - '946514' - - '946520' - - '946531' - - '946532' - - '946539' - - '946544' - - '946545' - - '946550' - - '946620' - - '946644' - - '946650' - - '946720' - - '946750' - - '946803' - - '946820' - - '946850' - - '946950' - - '947003' - - '947006' - - '947011' - - '947012' - - '947020' - - '947021' - - '947023' - - '947025' - - '947027' - - '947031' - - '947032' - - '947033' - - '947039' - - '947050' - - '947078' - - '947081' - - '947120' - - '947124' - - '947134' - - '947137' - - '947150' - - '947203' - - '947206' - - '947211' - - '947221' - - '947225' - - '947232' - - '947239' - - '947271' - - '947520' - - '947920' - - '947934' - - '947950' - - '948020' - - '948031' - - '948034' - - '948120' - - '948124' - - '948134' - - '948135' - - '948150' - - '948220' - - '948222' - - '948521' - - '948816' - - '948817' - - '948934' - - '949010' - - '949011' - - '949012' - - '949013' - - '949014' - - '949015' - - '949016' - - '949017' - - '949018' - - '949019' - - '949020' - - '949021' - - '949022' - - '949023' - - '949024' - - '949025' - - '949026' - - '949027' - - '949028' - - '949029' - - '949030' - - '949032' - - '949033' - - '949034' - - '949035' - - '949037' - - '949038' - - '949039' - - '949040' - - '949041' - - '949042' - - '949043' - - '949044' - - '949045' - - '949046' - - '949047' - - '949048' - - '949049' - - '949050' - - '949051' - - '949052' - - '949053' - - '949054' - - '949055' - - '949056' - - '949057' - - '949058' - - '949059' - - '949060' - - '949061' - - '949062' - - '949063' - - '949064' - - '949065' - - '949066' - - '949067' - - '949069' - - '949070' - - '949071' - - '949072' - - '949073' - - '949074' - - '949075' - - '949077' - - '949078' - - '949079' - - '949080' - - '949081' - - '949082' - - '949084' - - '949085' - - '949086' - - '949087' - - '949088' - - '949089' - - '949090' - - '949091' - - '949092' - - '949093' - - '949094' - - '949095' - - '949096' - - '949097' - - '949098' - - '949099' - - '949100' - - '949101' - - '949102' - - '949103' - - '949104' - - '949105' - - '949107' - - '950000' - - '950003' - - '950006' - - '950007' - - '950008' - - '950009' - - '950010' - - '950011' - - '950012' - - '950018' - - '950019' - - '950020' - - '951001' - - '951002' - - '953001' - - '953002' - - '953003' - - '953004' - - '953005' - - '970003' - - '970031' - - '970032' - - '970039' - - '970045' - - '971000' - - '972000' - - '999950' - - '999960' - - '999999' +# Updated 2023-04-01 +# See: https://ksnet.co.kr/Bbs/Details/?id=3021&ci=NOTICE +:korea_bin_numbers: + - '000110' + - '000111' + - '000112' + - '000113' + - '000114' + - '000115' + - '000116' + - '000117' + - '000118' + - '000119' + - '000120' + - '000121' + - '000122' + - '000123' + - '000124' + - '000125' + - '000126' + - '000127' + - '000128' + - '000129' + - '000130' + - '000131' + - '000132' + - '000133' + - '000134' + - '000135' + - '000136' + - '000137' + - '000138' + - '000139' + - '000140' + - '000141' + - '000142' + - '000143' + - '000144' + - '000145' + - '000146' + - '000147' + - '000148' + - '000149' + - '000150' + - '000151' + - '000152' + - '000153' + - '000154' + - '000155' + - '000156' + - '000157' + - '000158' + - '000159' + - '000190' + - '000191' + - '000192' + - '000193' + - '000194' + - '000195' + - '000196' + - '000197' + - '000198' + - '000199' + - '000210' + - '000211' + - '000212' + - '000213' + - '000214' + - '000215' + - '000216' + - '000217' + - '000218' + - '000219' + - '000220' + - '000221' + - '000222' + - '000223' + - '000224' + - '000225' + - '000226' + - '000227' + - '000228' + - '000229' + - '000230' + - '000231' + - '000232' + - '000233' + - '000234' + - '000235' + - '000236' + - '000237' + - '000238' + - '000239' + - '000240' + - '000241' + - '000242' + - '000243' + - '000244' + - '000245' + - '000246' + - '000247' + - '000248' + - '000249' + - '000250' + - '000251' + - '000252' + - '000253' + - '000254' + - '000255' + - '000256' + - '000257' + - '000258' + - '000259' + - '000510' + - '000511' + - '000512' + - '000513' + - '000514' + - '000515' + - '000516' + - '000517' + - '000518' + - '000519' + - '000520' + - '000521' + - '000522' + - '000523' + - '000524' + - '000525' + - '000526' + - '000527' + - '000528' + - '000529' + - '000530' + - '000531' + - '000532' + - '000533' + - '000534' + - '000535' + - '000536' + - '000537' + - '000538' + - '000539' + - '000540' + - '000541' + - '000542' + - '000543' + - '000544' + - '000545' + - '000546' + - '000547' + - '000548' + - '000549' + - '000550' + - '000551' + - '000552' + - '000553' + - '000554' + - '000555' + - '000556' + - '000557' + - '000558' + - '000559' + - '209304' + - '222879' + - '222884' + - '223152' + - '341122' + - '341348' + - '356003' + - '356006' + - '356011' + - '356012' + - '356020' + - '356021' + - '356022' + - '356023' + - '356024' + - '356025' + - '356027' + - '356031' + - '356032' + - '356036' + - '356039' + - '356078' + - '356087' + - '356234' + - '356283' + - '356290' + - '356291' + - '356292' + - '356293' + - '356294' + - '356295' + - '356296' + - '356297' + - '356298' + - '356303' + - '356306' + - '356311' + - '356312' + - '356316' + - '356317' + - '356320' + - '356321' + - '356322' + - '356323' + - '356324' + - '356325' + - '356327' + - '356331' + - '356332' + - '356336' + - '356339' + - '356406' + - '356407' + - '356413' + - '356414' + - '356415' + - '356416' + - '356417' + - '356454' + - '356478' + - '356479' + - '356503' + - '356506' + - '356511' + - '356512' + - '356516' + - '356517' + - '356520' + - '356521' + - '356522' + - '356523' + - '356527' + - '356531' + - '356532' + - '356534' + - '356539' + - '356543' + - '356544' + - '356545' + - '356653' + - '356686' + - '356687' + - '356716' + - '356717' + - '356741' + - '356744' + - '356745' + - '356747' + - '356748' + - '356800' + - '356801' + - '356802' + - '356803' + - '356820' + - '356823' + - '356824' + - '356878' + - '356891' + - '356892' + - '356900' + - '356901' + - '356902' + - '356904' + - '356905' + - '356906' + - '356907' + - '356908' + - '356910' + - '356911' + - '356912' + - '356914' + - '356915' + - '356916' + - '356920' + - '356932' + - '356978' + - '356979' + - '357104' + - '357116' + - '357117' + - '357118' + - '357119' + - '360043' + - '360069' + - '361246' + - '361247' + - '361248' + - '361650' + - '361651' + - '361652' + - '361653' + - '361654' + - '364124' + - '364125' + - '364178' + - '364445' + - '364681' + - '364682' + - '364683' + - '364828' + - '364829' + - '364830' + - '365405' + - '365431' + - '365573' + - '365574' + - '365645' + - '365646' + - '370299' + - '370300' + - '370301' + - '370302' + - '371001' + - '371002' + - '371003' + - '374664' + - '374722' + - '374723' + - '374724' + - '374725' + - '375144' + - '375145' + - '376250' + - '376251' + - '376252' + - '376253' + - '376254' + - '376255' + - '376256' + - '376257' + - '376258' + - '376259' + - '376260' + - '376261' + - '376262' + - '376263' + - '376264' + - '376265' + - '376266' + - '376267' + - '376268' + - '376269' + - '376270' + - '376271' + - '376272' + - '376273' + - '376274' + - '376275' + - '376276' + - '376277' + - '376278' + - '376279' + - '376290' + - '376291' + - '376292' + - '376293' + - '376364' + - '376365' + - '377177' + - '377178' + - '377328' + - '377345' + - '377346' + - '377374' + - '377649' + - '377966' + - '377969' + - '377973' + - '377981' + - '377982' + - '377983' + - '377985' + - '377988' + - '377989' + - '377990' + - '377991' + - '377992' + - '377993' + - '377994' + - '377995' + - '377996' + - '377997' + - '377998' + - '377999' + - '379183' + - '379184' + - '379192' + - '379193' + - '379194' + - '379220' + - '379348' + - '379349' + - '379350' + - '379351' + - '379557' + - '379907' + - '379909' + - '379910' + - '379971' + - '379985' + - '400223' + - '400558' + - '400569' + - '400674' + - '400772' + - '400904' + - '400905' + - '400906' + - '400907' + - '400911' + - '400912' + - '400913' + - '400933' + - '400978' + - '401278' + - '401320' + - '401570' + - '401571' + - '401584' + - '401585' + - '401678' + - '401762' + - '401787' + - '401844' + - '401895' + - '401898' + - '402017' + - '402072' + - '402175' + - '402367' + - '402502' + - '402515' + - '402516' + - '402517' + - '402596' + - '402822' + - '402857' + - '402858' + - '402859' + - '402860' + - '402952' + - '403012' + - '403290' + - '403293' + - '403302' + - '403346' + - '403548' + - '403803' + - '403811' + - '403812' + - '403831' + - '403832' + - '403839' + - '403878' + - '403965' + - '404149' + - '404331' + - '404332' + - '404336' + - '404339' + - '404577' + - '404613' + - '404619' + - '404678' + - '404720' + - '404726' + - '404727' + - '404728' + - '404803' + - '404806' + - '404811' + - '404812' + - '404820' + - '404822' + - '404823' + - '404825' + - '404933' + - '404947' + - '405203' + - '405207' + - '405220' + - '405331' + - '405388' + - '405432' + - '405438' + - '405665' + - '405691' + - '405692' + - '405753' + - '406078' + - '406107' + - '406158' + - '406357' + - '406703' + - '406706' + - '406711' + - '406712' + - '406721' + - '406723' + - '406725' + - '406731' + - '406732' + - '406733' + - '406745' + - '407407' + - '407423' + - '407424' + - '407455' + - '407467' + - '407469' + - '407503' + - '407541' + - '407558' + - '407589' + - '407590' + - '407603' + - '407785' + - '407912' + - '407916' + - '407917' + - '408320' + - '408539' + - '408907' + - '408966' + - '409085' + - '409216' + - '409217' + - '409231' + - '409232' + - '410109' + - '410120' + - '410278' + - '410378' + - '411026' + - '411072' + - '411133' + - '411471' + - '411825' + - '411896' + - '411897' + - '411904' + - '411905' + - '412020' + - '412921' + - '413005' + - '413253' + - '413526' + - '413700' + - '413720' + - '413780' + - '413837' + - '414003' + - '414006' + - '414011' + - '414012' + - '414020' + - '414023' + - '414025' + - '414027' + - '414031' + - '414032' + - '414036' + - '414039' + - '414296' + - '414520' + - '414625' + - '414710' + - '414743' + - '414744' + - '414749' + - '416206' + - '416207' + - '416237' + - '416324' + - '416332' + - '416339' + - '416455' + - '417103' + - '417233' + - '417256' + - '417920' + - '418143' + - '418163' + - '418164' + - '418173' + - '418236' + - '418237' + - '418510' + - '419187' + - '419696' + - '419697' + - '419698' + - '419699' + - '419803' + - '419933' + - '420025' + - '420178' + - '420189' + - '420190' + - '420701' + - '420707' + - '420920' + - '421111' + - '421112' + - '421120' + - '421123' + - '421131' + - '421132' + - '421134' + - '421139' + - '421403' + - '421406' + - '421411' + - '421417' + - '421418' + - '421420' + - '421421' + - '421423' + - '421425' + - '421427' + - '421431' + - '421432' + - '421439' + - '421468' + - '421573' + - '421607' + - '421685' + - '421733' + - '421810' + - '421820' + - '421923' + - '422015' + - '422016' + - '422018' + - '422155' + - '422190' + - '422715' + - '422717' + - '422727' + - '423174' + - '423210' + - '423217' + - '423950' + - '425863' + - '425920' + - '426066' + - '426504' + - '426578' + - '426586' + - '426907' + - '426920' + - '427120' + - '427203' + - '427220' + - '427221' + - '427223' + - '427227' + - '427231' + - '427232' + - '427239' + - '427329' + - '427352' + - '427386' + - '428411' + - '428412' + - '428431' + - '428432' + - '428465' + - '428696' + - '428697' + - '428908' + - '428909' + - '428920' + - '429212' + - '429498' + - '429499' + - '429612' + - '429972' + - '430305' + - '430603' + - '430969' + - '430972' + - '430984' + - '431236' + - '432445' + - '432627' + - '432632' + - '432768' + - '433010' + - '433028' + - '433087' + - '433290' + - '433521' + - '433692' + - '433693' + - '434346' + - '434347' + - '434976' + - '435661' + - '436417' + - '436420' + - '436422' + - '436477' + - '436511' + - '436550' + - '437368' + - '437432' + - '437436' + - '437539' + - '437719' + - '438265' + - '438654' + - '438676' + - '438901' + - '438902' + - '438922' + - '439110' + - '440025' + - '440445' + - '440446' + - '440447' + - '441657' + - '442136' + - '442660' + - '443567' + - '443569' + - '443579' + - '445056' + - '445090' + - '445096' + - '446054' + - '446603' + - '447320' + - '447703' + - '447781' + - '447820' + - '448111' + - '448112' + - '448122' + - '448123' + - '448124' + - '448125' + - '448127' + - '448132' + - '448133' + - '448135' + - '448143' + - '448168' + - '448492' + - '448494' + - '448523' + - '448537' + - '448550' + - '448555' + - '449914' + - '450025' + - '450203' + - '450596' + - '451099' + - '451245' + - '451279' + - '451281' + - '451842' + - '451843' + - '451844' + - '451845' + - '451846' + - '452013' + - '452022' + - '452373' + - '453123' + - '453261' + - '453934' + - '453936' + - '454303' + - '454478' + - '455303' + - '455306' + - '455311' + - '455312' + - '455320' + - '455323' + - '455325' + - '455331' + - '455332' + - '455339' + - '455420' + - '455437' + - '456037' + - '456058' + - '456702' + - '456703' + - '457047' + - '457048' + - '457318' + - '457492' + - '457493' + - '457972' + - '457973' + - '457992' + - '458484' + - '458525' + - '458532' + - '458568' + - '458967' + - '459222' + - '459855' + - '459860' + - '459900' + - '459901' + - '459903' + - '459904' + - '459906' + - '459912' + - '459930' + - '459936' + - '459950' + - '459951' + - '459953' + - '460074' + - '460205' + - '460561' + - '461724' + - '461771' + - '461774' + - '461775' + - '461781' + - '461954' + - '461980' + - '462890' + - '462898' + - '463235' + - '463732' + - '463916' + - '464022' + - '464092' + - '464562' + - '464637' + - '464647' + - '464942' + - '464955' + - '464959' + - '464960' + - '464965' + - '465306' + - '465518' + - '465521' + - '465522' + - '465523' + - '465524' + - '465583' + - '465613' + - '465887' + - '465888' + - '465889' + - '466571' + - '467006' + - '467007' + - '467008' + - '467009' + - '467069' + - '467077' + - '467119' + - '467120' + - '467121' + - '467122' + - '467123' + - '467309' + - '467963' + - '468780' + - '468781' + - '468782' + - '468908' + - '468909' + - '468911' + - '469536' + - '469537' + - '470349' + - '470399' + - '470547' + - '470587' + - '470588' + - '470616' + - '470617' + - '470618' + - '470630' + - '470631' + - '472175' + - '472246' + - '472263' + - '472264' + - '472429' + - '472637' + - '472650' + - '472897' + - '473058' + - '473059' + - '473844' + - '473853' + - '473867' + - '474289' + - '474290' + - '474360' + - '474361' + - '474420' + - '474523' + - '474524' + - '474606' + - '474607' + - '474608' + - '474817' + - '475503' + - '475506' + - '475511' + - '475512' + - '475520' + - '475522' + - '475523' + - '475524' + - '475525' + - '475527' + - '475531' + - '475532' + - '475536' + - '475539' + - '476020' + - '476021' + - '476063' + - '477065' + - '477570' + - '477949' + - '478892' + - '479016' + - '479021' + - '479588' + - '479589' + - '480074' + - '480400' + - '480417' + - '480422' + - '480434' + - '480443' + - '480444' + - '480450' + - '480451' + - '483543' + - '483544' + - '483578' + - '483592' + - '483632' + - '483639' + - '483735' + - '483736' + - '483792' + - '483793' + - '484062' + - '484087' + - '484809' + - '485462' + - '485475' + - '485476' + - '485477' + - '485478' + - '485479' + - '485480' + - '485492' + - '485493' + - '486058' + - '486230' + - '486467' + - '486468' + - '486469' + - '486475' + - '486578' + - '486579' + - '486678' + - '486679' + - '487033' + - '488906' + - '488919' + - '488920' + - '488921' + - '488972' + - '489010' + - '489016' + - '489023' + - '489515' + - '489904' + - '489930' + - '490011' + - '490012' + - '490020' + - '490220' + - '490274' + - '490298' + - '490603' + - '490606' + - '490611' + - '490612' + - '490620' + - '490623' + - '490625' + - '490631' + - '490632' + - '490639' + - '491217' + - '492511' + - '492512' + - '492752' + - '493020' + - '493046' + - '493163' + - '493455' + - '496603' + - '498737' + - '498819' + - '498820' + - '502123' + - '502928' + - '510003' + - '510279' + - '510315' + - '510554' + - '510737' + - '511070' + - '511187' + - '511390' + - '511845' + - '511877' + - '511911' + - '511929' + - '512028' + - '512114' + - '512351' + - '512352' + - '512353' + - '512354' + - '512355' + - '512359' + - '512365' + - '512462' + - '512609' + - '512635' + - '512647' + - '512668' + - '512813' + - '512830' + - '513041' + - '513243' + - '513459' + - '513462' + - '513480' + - '513708' + - '513723' + - '513739' + - '513791' + - '513792' + - '513893' + - '513894' + - '513895' + - '514043' + - '514091' + - '514110' + - '514473' + - '514557' + - '514564' + - '514645' + - '514876' + - '515197' + - '515363' + - '515408' + - '515594' + - '515606' + - '515708' + - '515954' + - '516006' + - '516078' + - '516191' + - '516341' + - '516411' + - '516450' + - '516453' + - '516520' + - '516526' + - '516546' + - '516574' + - '516695' + - '517067' + - '517134' + - '517220' + - '517332' + - '517364' + - '517548' + - '517560' + - '517575' + - '517662' + - '517709' + - '517827' + - '518135' + - '518140' + - '518185' + - '518283' + - '518319' + - '518420' + - '518432' + - '518669' + - '518781' + - '518831' + - '518928' + - '518929' + - '518930' + - '519023' + - '519157' + - '519303' + - '519335' + - '519635' + - '519657' + - '519718' + - '519751' + - '519892' + - '520025' + - '520045' + - '520215' + - '520217' + - '520421' + - '520422' + - '520504' + - '520613' + - '520667' + - '520779' + - '521126' + - '521135' + - '521176' + - '521186' + - '521189' + - '521717' + - '521718' + - '521826' + - '522051' + - '522111' + - '522112' + - '522114' + - '522115' + - '522119' + - '522123' + - '522124' + - '522125' + - '522129' + - '522420' + - '522447' + - '522509' + - '522802' + - '522855' + - '522894' + - '522971' + - '523040' + - '523401' + - '523402' + - '523410' + - '523424' + - '523504' + - '523521' + - '523527' + - '523612' + - '523651' + - '523830' + - '523930' + - '524012' + - '524013' + - '524014' + - '524015' + - '524019' + - '524021' + - '524022' + - '524023' + - '524024' + - '524025' + - '524028' + - '524029' + - '524041' + - '524140' + - '524141' + - '524144' + - '524180' + - '524220' + - '524223' + - '524225' + - '524226' + - '524242' + - '524283' + - '524285' + - '524333' + - '524335' + - '524531' + - '524603' + - '524688' + - '524713' + - '525316' + - '525549' + - '525563' + - '525783' + - '525872' + - '525982' + - '525989' + - '526198' + - '526251' + - '526373' + - '526878' + - '527182' + - '527257' + - '527289' + - '527419' + - '527585' + - '527731' + - '527810' + - '528054' + - '528268' + - '528274' + - '528523' + - '528638' + - '528664' + - '528665' + - '528692' + - '528815' + - '528936' + - '528937' + - '528938' + - '528949' + - '528951' + - '529014' + - '529269' + - '529803' + - '529875' + - '529877' + - '529899' + - '529942' + - '530108' + - '530369' + - '530432' + - '530468' + - '531070' + - '531072' + - '531080' + - '531082' + - '531085' + - '531088' + - '531130' + - '531194' + - '531408' + - '531764' + - '531838' + - '532092' + - '532105' + - '532147' + - '532188' + - '532288' + - '532296' + - '532444' + - '532707' + - '532750' + - '532793' + - '532799' + - '532913' + - '533032' + - '533349' + - '533427' + - '533774' + - '533827' + - '533872' + - '533909' + - '534132' + - '534291' + - '534292' + - '534553' + - '535020' + - '535052' + - '535180' + - '536125' + - '536142' + - '536148' + - '536181' + - '536320' + - '536323' + - '536326' + - '536460' + - '536510' + - '536539' + - '536548' + - '536617' + - '536623' + - '536624' + - '536648' + - '536683' + - '536802' + - '536883' + - '536945' + - '536946' + - '536984' + - '537042' + - '537044' + - '537102' + - '537120' + - '537145' + - '537614' + - '537620' + - '537659' + - '537692' + - '537699' + - '537703' + - '537706' + - '537711' + - '537712' + - '537720' + - '537723' + - '537725' + - '537727' + - '537731' + - '537732' + - '537736' + - '537739' + - '537834' + - '537943' + - '537952' + - '538003' + - '538159' + - '538165' + - '538179' + - '538720' + - '538733' + - '538803' + - '538806' + - '538811' + - '538812' + - '538820' + - '538823' + - '538825' + - '538827' + - '538831' + - '538832' + - '538836' + - '538839' + - '538903' + - '538920' + - '538941' + - '539030' + - '540388' + - '540447' + - '540486' + - '540497' + - '540528' + - '540537' + - '540538' + - '540554' + - '540591' + - '540689' + - '540799' + - '540926' + - '540947' + - '541145' + - '541259' + - '541633' + - '541707' + - '541757' + - '542158' + - '542184' + - '542220' + - '542265' + - '542416' + - '542448' + - '542564' + - '542586' + - '542720' + - '542879' + - '542934' + - '543017' + - '543241' + - '543333' + - '543341' + - '543617' + - '544004' + - '544082' + - '544120' + - '544167' + - '544174' + - '544203' + - '544689' + - '545089' + - '545925' + - '546111' + - '546112' + - '546252' + - '546418' + - '546465' + - '546596' + - '547109' + - '547149' + - '547227' + - '547460' + - '547609' + - '547671' + - '547924' + - '548020' + - '548213' + - '548238' + - '548596' + - '548728' + - '548732' + - '548750' + - '548781' + - '548811' + - '548816' + - '548818' + - '548841' + - '548869' + - '548870' + - '548933' + - '549029' + - '549153' + - '549155' + - '549509' + - '549737' + - '549840' + - '549861' + - '550000' + - '550347' + - '550744' + - '551431' + - '552014' + - '552051' + - '552052' + - '552087' + - '552103' + - '552106' + - '552111' + - '552112' + - '552120' + - '552122' + - '552123' + - '552125' + - '552131' + - '552132' + - '552133' + - '552136' + - '552139' + - '552164' + - '552194' + - '552220' + - '552248' + - '552290' + - '552323' + - '552376' + - '552377' + - '552386' + - '552387' + - '552407' + - '552412' + - '552423' + - '552432' + - '552441' + - '552445' + - '552521' + - '552532' + - '552537' + - '552576' + - '552803' + - '552806' + - '552811' + - '552812' + - '552823' + - '552920' + - '553078' + - '553109' + - '553142' + - '553144' + - '553146' + - '553147' + - '553150' + - '553151' + - '553152' + - '553155' + - '553168' + - '553169' + - '553171' + - '553172' + - '553173' + - '553176' + - '553177' + - '553178' + - '553179' + - '553180' + - '553181' + - '553184' + - '553190' + - '553208' + - '553211' + - '553212' + - '553213' + - '553214' + - '553219' + - '553220' + - '553221' + - '553224' + - '553225' + - '553406' + - '553423' + - '553531' + - '553615' + - '553820' + - '554049' + - '554345' + - '554349' + - '554382' + - '554481' + - '554578' + - '554620' + - '554648' + - '554921' + - '554959' + - '555023' + - '555111' + - '555112' + - '555120' + - '555121' + - '555131' + - '555132' + - '555133' + - '555139' + - '555231' + - '555870' + - '555904' + - '555916' + - '556608' + - '556659' + - '556678' + - '557042' + - '557162' + - '557712' + - '557811' + - '557889' + - '558370' + - '558420' + - '558453' + - '558503' + - '558506' + - '558511' + - '558512' + - '558520' + - '558521' + - '558523' + - '558525' + - '558526' + - '558527' + - '558531' + - '558532' + - '558536' + - '558539' + - '558735' + - '558738' + - '558749' + - '558768' + - '558813' + - '558817' + - '558822' + - '558875' + - '558881' + - '558885' + - '558903' + - '558906' + - '558911' + - '558912' + - '558914' + - '558915' + - '558917' + - '558920' + - '558921' + - '558922' + - '558923' + - '558924' + - '558925' + - '558927' + - '558931' + - '558932' + - '558939' + - '558950' + - '558953' + - '558961' + - '558970' + - '558971' + - '558972' + - '558975' + - '558976' + - '558978' + - '559084' + - '559123' + - '559246' + - '559293' + - '559329' + - '559410' + - '559434' + - '559438' + - '559571' + - '559588' + - '559620' + - '559631' + - '559632' + - '559639' + - '559869' + - '559913' + - '559924' + - '559957' + - '559962' + - '604823' + - '605615' + - '606045' + - '606052' + - '620011' + - '620027' + - '620031' + - '620039' + - '620103' + - '620106' + - '620120' + - '620123' + - '620125' + - '620132' + - '620220' + - '620278' + - '620812' + - '621003' + - '621006' + - '621011' + - '621012' + - '621020' + - '621023' + - '621025' + - '621027' + - '621031' + - '621032' + - '621039' + - '621051' + - '621078' + - '621079' + - '621220' + - '621249' + - '621484' + - '621640' + - '621641' + - '623024' + - '623322' + - '623323' + - '623329' + - '623340' + - '623341' + - '623358' + - '623374' + - '623379' + - '623387' + - '623390' + - '623391' + - '623392' + - '623393' + - '623394' + - '623395' + - '623451' + - '623452' + - '623453' + - '623454' + - '623470' + - '623489' + - '624313' + - '624320' + - '624321' + - '624324' + - '624325' + - '624331' + - '624332' + - '624333' + - '624335' + - '624336' + - '624339' + - '624340' + - '624344' + - '624345' + - '624346' + - '624347' + - '624348' + - '624349' + - '624350' + - '624358' + - '624359' + - '624360' + - '624361' + - '624362' + - '624363' + - '624368' + - '624370' + - '624373' + - '624374' + - '624375' + - '624376' + - '624377' + - '624378' + - '624379' + - '624380' + - '624381' + - '624382' + - '624383' + - '624384' + - '624387' + - '624388' + - '624389' + - '624399' + - '624400' + - '624401' + - '624403' + - '624404' + - '624406' + - '624410' + - '624411' + - '624414' + - '624420' + - '624424' + - '624427' + - '624432' + - '624434' + - '624435' + - '624436' + - '624437' + - '624440' + - '624441' + - '624442' + - '624443' + - '624444' + - '624446' + - '624448' + - '624449' + - '624450' + - '624451' + - '624452' + - '624462' + - '624471' + - '624479' + - '624480' + - '624482' + - '625003' + - '625006' + - '625011' + - '625012' + - '625020' + - '625023' + - '625025' + - '625027' + - '625031' + - '625032' + - '625039' + - '625078' + - '625079' + - '625103' + - '625106' + - '625111' + - '625112' + - '625120' + - '625123' + - '625125' + - '625127' + - '625131' + - '625132' + - '625139' + - '625178' + - '625179' + - '625220' + - '625241' + - '625242' + - '625243' + - '625244' + - '625245' + - '625246' + - '625320' + - '625804' + - '625814' + - '625817' + - '625840' + - '625841' + - '625904' + - '626199' + - '626222' + - '626236' + - '626237' + - '626250' + - '626251' + - '626261' + - '626275' + - '626277' + - '626303' + - '626344' + - '626399' + - '626400' + - '626402' + - '626409' + - '626415' + - '626416' + - '626422' + - '626426' + - '628180' + - '629141' + - '636078' + - '636093' + - '636094' + - '636095' + - '636189' + - '639339' + - '639341' + - '639578' + - '639650' + - '654103' + - '654106' + - '654111' + - '654112' + - '654115' + - '654116' + - '654117' + - '654120' + - '654123' + - '654125' + - '654127' + - '654131' + - '654132' + - '654139' + - '654150' + - '654203' + - '654206' + - '654211' + - '654212' + - '654215' + - '654220' + - '654223' + - '654225' + - '654227' + - '654231' + - '654232' + - '654239' + - '654250' + - '654900' + - '654901' + - '655603' + - '655606' + - '655611' + - '655612' + - '655614' + - '655615' + - '655616' + - '655617' + - '655618' + - '655620' + - '655623' + - '655625' + - '655627' + - '655631' + - '655632' + - '655639' + - '655650' + - '655803' + - '655806' + - '655811' + - '655812' + - '655814' + - '655815' + - '655816' + - '655817' + - '655818' + - '655820' + - '655823' + - '655825' + - '655827' + - '655831' + - '655832' + - '655839' + - '655850' + - '655916' + - '655918' + - '655920' + - '657016' + - '657018' + - '657020' + - '657031' + - '657032' + - '657039' + - '657303' + - '657306' + - '657311' + - '657312' + - '657314' + - '657315' + - '657316' + - '657317' + - '657318' + - '657320' + - '657323' + - '657325' + - '657327' + - '657331' + - '657332' + - '657339' + - '657350' + - '700100' + - '700101' + - '700105' + - '700106' + - '700107' + - '700109' + - '700116' + - '700117' + - '700126' + - '700127' + - '720002' + - '720031' + - '720032' + - '720033' + - '720041' + - '720042' + - '720043' + - '720044' + - '720051' + - '720052' + - '720053' + - '720054' + - '720055' + - '720061' + - '720062' + - '720063' + - '720064' + - '834000' + - '834024' + - '834026' + - '871001' + - '881001' + - '900001' + - '900050' + - '900101' + - '903501' + - '903502' + - '903503' + - '903504' + - '903505' + - '903516' + - '903517' + - '903518' + - '903519' + - '903520' + - '903551' + - '903552' + - '903553' + - '903554' + - '903555' + - '910003' + - '910006' + - '910007' + - '910011' + - '910012' + - '910020' + - '910021' + - '910023' + - '910025' + - '910027' + - '910031' + - '910032' + - '910034' + - '910035' + - '910036' + - '910037' + - '910039' + - '910040' + - '910050' + - '910120' + - '910150' + - '910550' + - '920002' + - '920003' + - '920006' + - '920007' + - '920009' + - '920011' + - '920012' + - '920013' + - '920014' + - '920018' + - '920020' + - '920021' + - '920023' + - '920025' + - '920027' + - '920030' + - '920031' + - '920032' + - '920034' + - '920035' + - '920036' + - '920037' + - '920039' + - '920044' + - '920045' + - '920048' + - '920049' + - '920050' + - '920051' + - '920059' + - '920061' + - '920063' + - '920064' + - '920071' + - '920077' + - '920079' + - '920080' + - '920082' + - '920085' + - '920086' + - '920087' + - '920091' + - '920092' + - '920093' + - '920094' + - '920095' + - '920096' + - '920120' + - '920215' + - '920232' + - '920239' + - '920315' + - '920432' + - '920439' + - '930003' + - '930007' + - '930011' + - '930020' + - '930023' + - '930025' + - '930031' + - '930032' + - '930034' + - '930037' + - '930039' + - '930050' + - '930051' + - '930102' + - '930103' + - '930107' + - '930111' + - '930112' + - '930118' + - '930120' + - '930123' + - '930125' + - '930131' + - '930132' + - '930139' + - '930144' + - '930146' + - '930150' + - '935003' + - '935007' + - '935016' + - '935017' + - '935020' + - '935023' + - '935031' + - '935032' + - '935034' + - '935037' + - '935039' + - '935048' + - '935071' + - '940010' + - '940011' + - '940012' + - '940017' + - '940020' + - '940030' + - '940040' + - '940050' + - '940060' + - '940070' + - '940080' + - '940090' + - '940327' + - '940388' + - '940701' + - '940702' + - '940703' + - '940704' + - '940706' + - '940707' + - '940708' + - '940910' + - '940911' + - '940912' + - '940913' + - '940914' + - '940915' + - '940916' + - '940917' + - '940918' + - '940919' + - '940920' + - '940921' + - '940922' + - '940923' + - '940924' + - '940925' + - '940926' + - '940927' + - '940928' + - '940929' + - '940930' + - '940931' + - '940932' + - '940933' + - '940934' + - '940935' + - '940936' + - '940937' + - '940938' + - '940939' + - '940940' + - '940941' + - '940942' + - '940943' + - '940945' + - '940947' + - '940948' + - '940949' + - '940951' + - '940952' + - '940953' + - '940955' + - '940956' + - '940957' + - '940958' + - '940960' + - '940961' + - '940962' + - '940963' + - '940964' + - '940965' + - '940966' + - '940967' + - '940968' + - '940969' + - '940970' + - '940971' + - '940972' + - '940973' + - '940974' + - '940975' + - '940976' + - '940977' + - '940978' + - '940979' + - '940980' + - '940981' + - '940982' + - '940983' + - '940984' + - '940985' + - '940986' + - '940991' + - '940999' + - '941000' + - '941001' + - '941002' + - '941003' + - '941004' + - '941005' + - '941006' + - '941008' + - '941009' + - '941010' + - '941011' + - '941012' + - '941013' + - '941014' + - '941015' + - '941017' + - '941018' + - '941019' + - '941020' + - '941021' + - '941022' + - '941023' + - '941024' + - '941025' + - '941026' + - '941027' + - '941028' + - '941029' + - '941030' + - '941031' + - '941032' + - '941034' + - '941035' + - '941036' + - '941037' + - '941038' + - '941039' + - '941044' + - '941049' + - '941050' + - '941051' + - '941052' + - '941053' + - '941056' + - '941057' + - '941058' + - '941059' + - '941060' + - '941061' + - '941062' + - '941063' + - '941064' + - '941065' + - '941066' + - '941067' + - '941068' + - '941069' + - '941071' + - '941073' + - '941074' + - '941075' + - '941076' + - '941077' + - '941078' + - '941080' + - '941081' + - '941082' + - '941083' + - '941084' + - '941085' + - '941086' + - '941088' + - '941089' + - '941090' + - '941091' + - '941092' + - '941093' + - '941094' + - '941095' + - '941096' + - '941097' + - '941098' + - '941099' + - '941111' + - '941112' + - '941116' + - '941117' + - '941120' + - '941122' + - '941124' + - '941150' + - '941161' + - '941177' + - '941178' + - '941179' + - '941180' + - '941181' + - '941183' + - '941184' + - '941185' + - '941186' + - '941187' + - '941188' + - '941189' + - '941190' + - '941191' + - '941192' + - '941194' + - '941195' + - '941199' + - '941216' + - '941217' + - '941222' + - '941224' + - '941281' + - '941316' + - '941317' + - '941381' + - '941450' + - '941520' + - '941581' + - '941607' + - '941620' + - '941623' + - '941631' + - '941632' + - '941634' + - '941635' + - '941636' + - '941637' + - '941639' + - '941642' + - '941643' + - '941645' + - '941648' + - '941650' + - '941671' + - '941681' + - '941691' + - '941696' + - '941707' + - '941711' + - '941712' + - '941722' + - '941723' + - '941724' + - '941725' + - '941731' + - '941732' + - '941734' + - '941735' + - '941736' + - '941737' + - '941739' + - '941750' + - '941781' + - '941807' + - '941881' + - '941934' + - '941981' + - '942003' + - '942006' + - '942011' + - '942012' + - '942018' + - '942019' + - '942020' + - '942021' + - '942022' + - '942023' + - '942024' + - '942025' + - '942027' + - '942031' + - '942032' + - '942034' + - '942035' + - '942036' + - '942039' + - '942061' + - '942062' + - '942063' + - '942064' + - '942065' + - '942069' + - '942070' + - '942072' + - '942073' + - '942074' + - '942075' + - '942076' + - '942077' + - '942078' + - '942081' + - '942082' + - '942083' + - '942084' + - '942085' + - '942086' + - '942087' + - '942088' + - '942089' + - '942090' + - '942091' + - '942092' + - '942093' + - '942094' + - '942095' + - '942096' + - '942099' + - '942101' + - '942102' + - '942103' + - '942104' + - '942105' + - '942106' + - '942107' + - '942120' + - '942122' + - '942123' + - '942124' + - '942132' + - '942150' + - '942199' + - '942203' + - '942220' + - '942222' + - '942224' + - '942239' + - '942520' + - '942522' + - '942524' + - '942620' + - '942622' + - '942624' + - '942720' + - '942820' + - '942822' + - '943003' + - '943006' + - '943011' + - '943012' + - '943016' + - '943017' + - '943020' + - '943021' + - '943022' + - '943023' + - '943024' + - '943025' + - '943027' + - '943031' + - '943032' + - '943034' + - '943036' + - '943039' + - '943050' + - '943062' + - '943078' + - '943081' + - '943116' + - '943117' + - '943132' + - '943133' + - '943134' + - '943135' + - '943136' + - '943137' + - '943138' + - '943139' + - '943140' + - '943141' + - '943142' + - '943143' + - '943144' + - '943145' + - '943146' + - '943147' + - '943148' + - '943149' + - '943150' + - '943151' + - '943152' + - '943153' + - '943154' + - '943155' + - '943156' + - '943157' + - '943158' + - '943159' + - '943160' + - '943161' + - '943163' + - '943164' + - '943165' + - '943166' + - '943181' + - '943210' + - '943211' + - '943212' + - '943213' + - '943214' + - '943215' + - '943216' + - '943281' + - '943381' + - '943416' + - '943417' + - '943481' + - '943520' + - '943543' + - '943544' + - '943581' + - '943645' + - '943646' + - '943648' + - '943649' + - '943651' + - '943661' + - '943666' + - '943667' + - '943681' + - '943711' + - '943712' + - '943713' + - '943714' + - '943715' + - '943721' + - '943722' + - '943723' + - '943724' + - '943725' + - '943726' + - '943727' + - '943731' + - '943740' + - '943741' + - '943742' + - '943743' + - '943744' + - '943745' + - '943746' + - '943747' + - '943748' + - '943781' + - '943881' + - '943907' + - '943920' + - '943921' + - '943924' + - '943925' + - '943950' + - '943978' + - '944002' + - '944003' + - '944006' + - '944007' + - '944009' + - '944011' + - '944012' + - '944018' + - '944020' + - '944021' + - '944022' + - '944023' + - '944024' + - '944025' + - '944027' + - '944030' + - '944031' + - '944032' + - '944034' + - '944039' + - '944043' + - '944044' + - '944045' + - '944048' + - '944061' + - '944063' + - '944064' + - '944071' + - '944078' + - '944079' + - '944080' + - '944081' + - '944095' + - '944096' + - '944100' + - '944101' + - '944103' + - '944104' + - '944106' + - '944108' + - '944109' + - '944110' + - '944111' + - '944112' + - '944113' + - '944114' + - '944115' + - '944116' + - '944117' + - '944118' + - '944119' + - '944120' + - '944122' + - '944124' + - '944126' + - '944127' + - '944128' + - '944129' + - '944130' + - '944131' + - '944132' + - '944133' + - '944134' + - '944135' + - '944138' + - '944139' + - '944140' + - '944143' + - '944144' + - '944145' + - '944146' + - '944147' + - '944148' + - '944149' + - '944150' + - '944151' + - '944152' + - '944153' + - '944154' + - '944155' + - '944171' + - '944181' + - '944182' + - '944187' + - '944192' + - '944193' + - '944194' + - '944196' + - '944203' + - '944211' + - '944212' + - '944216' + - '944217' + - '944222' + - '944224' + - '944234' + - '944243' + - '944281' + - '944303' + - '944306' + - '944307' + - '944311' + - '944312' + - '944320' + - '944322' + - '944324' + - '944331' + - '944334' + - '944350' + - '944386' + - '944403' + - '944411' + - '944412' + - '944420' + - '944422' + - '944431' + - '944443' + - '944520' + - '944522' + - '944524' + - '944541' + - '944542' + - '944543' + - '944545' + - '944546' + - '944547' + - '944548' + - '944549' + - '944550' + - '944551' + - '944552' + - '944554' + - '944555' + - '944556' + - '944557' + - '944558' + - '944560' + - '944561' + - '944603' + - '944620' + - '944622' + - '944624' + - '944631' + - '944664' + - '944691' + - '944696' + - '944703' + - '944707' + - '944711' + - '944720' + - '944722' + - '944732' + - '944912' + - '944920' + - '944934' + - '944948' + - '944949' + - '944950' + - '945003' + - '945006' + - '945007' + - '945011' + - '945012' + - '945020' + - '945021' + - '945023' + - '945025' + - '945027' + - '945031' + - '945032' + - '945033' + - '945034' + - '945035' + - '945039' + - '945078' + - '945081' + - '945103' + - '945107' + - '945111' + - '945112' + - '945120' + - '945122' + - '945124' + - '945131' + - '945132' + - '945150' + - '945161' + - '945162' + - '945203' + - '945211' + - '945212' + - '945220' + - '945320' + - '945324' + - '945420' + - '945511' + - '945520' + - '945620' + - '945720' + - '945810' + - '945811' + - '945812' + - '945813' + - '945814' + - '945815' + - '945816' + - '945817' + - '945818' + - '945819' + - '945820' + - '945821' + - '945822' + - '945823' + - '945824' + - '945825' + - '945903' + - '945920' + - '945934' + - '946003' + - '946006' + - '946007' + - '946011' + - '946012' + - '946016' + - '946017' + - '946020' + - '946021' + - '946022' + - '946023' + - '946024' + - '946025' + - '946027' + - '946031' + - '946032' + - '946033' + - '946034' + - '946039' + - '946044' + - '946046' + - '946050' + - '946051' + - '946078' + - '946081' + - '946103' + - '946106' + - '946111' + - '946112' + - '946116' + - '946117' + - '946120' + - '946121' + - '946123' + - '946124' + - '946127' + - '946131' + - '946132' + - '946134' + - '946137' + - '946139' + - '946144' + - '946150' + - '946178' + - '946181' + - '946216' + - '946217' + - '946220' + - '946222' + - '946224' + - '946250' + - '946253' + - '946260' + - '946272' + - '946285' + - '946304' + - '946309' + - '946316' + - '946317' + - '946320' + - '946332' + - '946334' + - '946350' + - '946352' + - '946361' + - '946365' + - '946370' + - '946372' + - '946403' + - '946406' + - '946411' + - '946412' + - '946420' + - '946422' + - '946423' + - '946424' + - '946427' + - '946431' + - '946432' + - '946439' + - '946450' + - '946478' + - '946503' + - '946511' + - '946512' + - '946513' + - '946514' + - '946520' + - '946531' + - '946532' + - '946539' + - '946544' + - '946545' + - '946550' + - '946620' + - '946631' + - '946632' + - '946644' + - '946650' + - '946720' + - '946731' + - '946750' + - '946803' + - '946820' + - '946831' + - '946850' + - '946904' + - '946908' + - '946920' + - '946950' + - '946952' + - '946961' + - '947003' + - '947006' + - '947011' + - '947012' + - '947020' + - '947021' + - '947023' + - '947025' + - '947027' + - '947031' + - '947032' + - '947033' + - '947039' + - '947050' + - '947078' + - '947081' + - '947120' + - '947124' + - '947134' + - '947137' + - '947150' + - '947181' + - '947203' + - '947206' + - '947211' + - '947221' + - '947225' + - '947232' + - '947239' + - '947271' + - '947520' + - '947920' + - '947934' + - '947950' + - '948001' + - '948002' + - '948003' + - '948020' + - '948022' + - '948031' + - '948034' + - '948050' + - '948051' + - '948120' + - '948122' + - '948124' + - '948125' + - '948134' + - '948135' + - '948150' + - '948151' + - '948220' + - '948222' + - '948224' + - '948234' + - '948250' + - '948251' + - '948521' + - '948816' + - '948817' + - '948934' + - '949001' + - '949002' + - '949003' + - '949004' + - '949005' + - '949008' + - '949009' + - '949010' + - '949011' + - '949012' + - '949013' + - '949014' + - '949015' + - '949016' + - '949017' + - '949018' + - '949019' + - '949020' + - '949021' + - '949022' + - '949023' + - '949024' + - '949025' + - '949026' + - '949027' + - '949028' + - '949029' + - '949030' + - '949032' + - '949033' + - '949034' + - '949035' + - '949036' + - '949037' + - '949038' + - '949039' + - '949040' + - '949041' + - '949042' + - '949043' + - '949044' + - '949045' + - '949046' + - '949047' + - '949048' + - '949049' + - '949050' + - '949051' + - '949052' + - '949053' + - '949054' + - '949055' + - '949056' + - '949057' + - '949058' + - '949059' + - '949060' + - '949061' + - '949062' + - '949063' + - '949064' + - '949065' + - '949066' + - '949067' + - '949068' + - '949069' + - '949070' + - '949071' + - '949072' + - '949074' + - '949075' + - '949077' + - '949078' + - '949079' + - '949080' + - '949082' + - '949084' + - '949085' + - '949086' + - '949087' + - '949088' + - '949089' + - '949090' + - '949091' + - '949092' + - '949093' + - '949094' + - '949095' + - '949096' + - '949097' + - '949098' + - '949099' + - '949100' + - '949101' + - '949102' + - '949103' + - '949104' + - '949105' + - '949106' + - '949107' + - '949108' + - '949109' + - '949110' + - '949111' + - '949112' + - '949113' + - '949120' + - '949121' + - '949122' + - '949123' + - '949124' + - '949125' + - '949126' + - '949127' + - '949128' + - '949129' + - '949130' + - '949131' + - '949132' + - '949133' + - '949134' + - '949135' + - '949136' + - '949137' + - '949211' + - '949447' + - '949533' + - '949545' + - '949547' + - '949551' + - '949552' + - '949811' + - '950000' + - '950001' + - '950002' + - '950003' + - '950005' + - '950006' + - '950007' + - '950008' + - '950009' + - '950010' + - '950011' + - '950012' + - '950018' + - '950019' + - '950020' + - '950061' + - '950062' + - '950090' + - '950091' + - '950092' + - '950093' + - '950094' + - '950095' + - '950096' + - '950097' + - '950098' + - '950099' + - '951001' + - '951002' + - '952001' + - '952061' + - '953001' + - '953002' + - '953003' + - '953004' + - '953005' + - '954034' + - '954039' + - '954049' + - '954334' + - '960161' + - '960167' + - '960171' + - '960172' + - '970003' + - '970031' + - '970032' + - '970039' + - '970045' + - '971000' + - '971001' + - '971002' + - '971003' + - '971004' + - '971010' + - '972000' + - '999950' + - '999960' + - '999977' + - '999999' + - '22315110' + - '37954101' + - '37954102' + - '40022351' + - '40022360' + - '40022361' + - '40022362' + - '40022363' + - '40022364' + - '40482351' + - '40482360' + - '40482361' + - '40482362' + - '40482363' + - '40482364' + - '40672360' + - '40672361' + - '40672362' + - '40672363' + - '40672364' + - '40672398' + - '40908551' + - '40908560' + - '40908561' + - '40908562' + - '40908563' + - '40908564' + - '41300500' + - '41300560' + - '41402100' + - '41402350' + - '41402360' + - '41402361' + - '41402362' + - '41402363' + - '41402364' + - '41993343' + - '41993344' + - '41993360' + - '41993361' + - '41993362' + - '41993363' + - '41993364' + - '41993365' + - '41993366' + - '41993367' + - '41993368' + - '41993369' + - '42002544' + - '42002560' + - '42002561' + - '42002562' + - '42002563' + - '42002564' + - '42002565' + - '42002566' + - '42002567' + - '42002568' + - '42002569' + - '42183433' + - '42183434' + - '42183481' + - '43368900' + - '44044700' + - '44044800' + - '44810300' + - '44812351' + - '44812360' + - '44812361' + - '44812362' + - '44812363' + - '44812364' + - '45072100' + - '45189000' + - '45326100' + - '45326160' + - '45326161' + - '45326162' + - '45326163' + - '45326164' + - '45326165' + - '45326166' + - '45326167' + - '45326168' + - '45326169' + - '45532351' + - '45532360' + - '45532361' + - '45532362' + - '45532363' + - '45532364' + - '45661600' + - '45662900' + - '45665500' + - '45790600' + - '45799300' + - '45985500' + - '45985560' + - '45990229' + - '45990233' + - '45990234' + - '45990281' + - '45991200' + - '45991260' + - '45991261' + - '45991262' + - '45991263' + - '45991264' + - '45991265' + - '45991266' + - '45991267' + - '45991268' + - '45991269' + - '45992700' + - '45992800' + - '45992900' + - '45995229' + - '45995233' + - '45995234' + - '45995272' + - '45995281' + - '46561300' + - '46561360' + - '46561361' + - '46561362' + - '46561363' + - '46561364' + - '46561365' + - '46561366' + - '46561367' + - '46561368' + - '46561369' + - '46953600' + - '47552350' + - '47552360' + - '47552361' + - '47552362' + - '47552363' + - '47552364' + - '47902200' + - '47902500' + - '48007400' + - '48007412' + - '48007413' + - '48007429' + - '48546200' + - '48546260' + - '48546261' + - '48546262' + - '48546263' + - '48546264' + - '48546265' + - '48546266' + - '48546267' + - '48546268' + - '48546269' + - '49060900' + - '49061000' + - '49061300' + - '49062351' + - '49062360' + - '49062361' + - '49062362' + - '49062363' + - '49062364' + - '49410300' + - '49876100' + - '51519333' + - '51519334' + - '52095789' + - '52352751' + - '52352760' + - '52352761' + - '52352762' + - '52352763' + - '52352764' + - '52499057' + - '52928133' + - '52928134' + - '52931810' + - '53141019' + - '53301481' + - '53301482' + - '53333730' + - '53649897' + - '53655882' + - '53662349' + - '53662351' + - '53662360' + - '53662361' + - '53662362' + - '53662363' + - '53662364' + - '53665281' + - '53665293' + - '53766280' + - '54172181' + - '54172182' + - '55282360' + - '55282361' + - '55282362' + - '55282363' + - '55282364' + - '55282398' + - '55315981' + - '55315982' + - '55372733' + - '55372734' + - '55892350' + - '55892360' + - '55892361' + - '55892362' + - '55892363' + - '55892364' + - '60482349' + - '60482351' + - '60482360' + - '60482361' + - '60482362' + - '60482363' + - '60482364' + - '62630169' + - '62630170' + - '62630171' + - '62642540' + - '62642541' + - '94428160' diff --git a/lib/paygate-ruby.rb b/lib/paygate-ruby.rb index d942f16..785acb2 100644 --- a/lib/paygate-ruby.rb +++ b/lib/paygate-ruby.rb @@ -7,18 +7,13 @@ require 'paygate/response' require 'paygate/transaction' require 'paygate/profile' -require 'paygate/helpers/form_helper' if defined?(ActionView) +require 'paygate/action_view/form_helper' if defined?(ActionView) module Paygate - if defined?(Rails) - class Engine < ::Rails::Engine; end - end - CONFIG = YAML.load(File.read(File.expand_path('../data/config.yml', File.dirname(__FILE__)))).freeze LOCALES_MAP = CONFIG[:locales].freeze - INTL_BRANDS_MAP = CONFIG[:intl][:brands].freeze - KOREA_BIN_NUMBERS = CONFIG[:korea][:bin_numbers].freeze - + INTL_BRANDS_MAP = CONFIG[:intl_brands].freeze + KOREA_BIN_NUMBERS = CONFIG[:korea_bin_numbers].freeze DEFAULT_CURRENCY = 'WON'.freeze DEFAULT_LOCALE = 'US'.freeze diff --git a/lib/paygate/helpers/form_helper.rb b/lib/paygate/action_view/form_helper.rb similarity index 96% rename from lib/paygate/helpers/form_helper.rb rename to lib/paygate/action_view/form_helper.rb index 5a70c63..5cd434a 100644 --- a/lib/paygate/helpers/form_helper.rb +++ b/lib/paygate/action_view/form_helper.rb @@ -1,6 +1,7 @@ module Paygate +module ActionView module FormHelper - FORM_TEXT_FIELDS = { + PAYGATE_FORM_TEXT_FIELDS = { mid: { placeholder: 'Member ID' }, @@ -132,7 +133,7 @@ def paygate_open_pay_api_form(options = {}) form_tag({}, name: 'PGIOForm') do fields = [] - FORM_TEXT_FIELDS.each do |key, opts| + PAYGATE_FORM_TEXT_FIELDS.each do |key, opts| arg_opts = options[key] || {} fields << text_field_tag( key, @@ -151,5 +152,4 @@ def paygate_open_pay_api_screen end end end - -ActionView::Base.send :include, Paygate::FormHelper +end diff --git a/lib/paygate/aes_ctr.rb b/lib/paygate/aes_ctr.rb index a98b451..1071da0 100644 --- a/lib/paygate/aes_ctr.rb +++ b/lib/paygate/aes_ctr.rb @@ -13,7 +13,7 @@ class AesCtr # @returns string Encrypted text def self.encrypt(plaintext, password, num_bits) block_size = 16 # block size fixed at 16 bytes / 128 bits (Nb=4) for AES - return '' unless num_bits.in?([128, 192, 256]) + return '' unless [128, 192, 256].include?(num_bits) # use AES itself to encrypt password to get cipher key (using plain password as source for key # expansion) - gives us well encrypted key (though hashed key might be preferred for prod'n use) @@ -60,7 +60,7 @@ def self.encrypt(plaintext, password, num_bits) end cipher_text = ctr_text + cipher_text.join - cipher_text = Base64.encode64(cipher_text).gsub(/\n/, '') + "\n"; # encode in base64 + Base64.encode64(cipher_text).gsub(/\n/, '') + "\n" # encode in base64 end # Decrypt a text encrypted by AES in counter mode of operation @@ -73,7 +73,7 @@ def self.encrypt(plaintext, password, num_bits) def self.decrypt(ciphertext, password, nBits) blockSize = 16 # block size fixed at 16 bytes / 128 bits (Nb=4) for AES return '' unless(nBits==128 || nBits==192 || nBits==256) - ciphertext = Base64.decode64(ciphertext); + ciphertext = Base64.decode64(ciphertext) nBytes = nBits/8 # no bytes in key (16/24/32) pwBytes = [] @@ -86,7 +86,7 @@ def self.decrypt(ciphertext, password, nBits) 0.upto(7){|i| counterBlock[i] = ctrTxt.bytes.to_a[i]} #generate key Schedule - keySchedule = Aes.key_expansion(key); + keySchedule = Aes.key_expansion(key) # separate ciphertext into blocks (skipping past initial 8 bytes) nBlocks = ((ciphertext.length-8)/blockSize.to_f).ceil @@ -96,7 +96,7 @@ def self.decrypt(ciphertext, password, nBits) ciphertext = ct; # ciphertext is now array of block-length strings # plaintext will get generated block-by-block into array of block-length strings - plaintxt = []; + plaintxt = [] 0.upto(nBlocks-1) do |b| 0.upto(3){|c| counterBlock[15-c] = urs(b,c*8) & 0xff} 0.upto(3){|c| counterBlock[15-c-4] = urs((b+1)/(0x100000000-1),c*8) & 0xff} @@ -108,7 +108,7 @@ def self.decrypt(ciphertext, password, nBits) end plaintxt[b] = plaintxtByte.join('') end - plaintext = plaintxt.join('') + plaintxt.join('') end private diff --git a/lib/paygate/configuration.rb b/lib/paygate/configuration.rb index 0b4ab39..8164772 100644 --- a/lib/paygate/configuration.rb +++ b/lib/paygate/configuration.rb @@ -1,6 +1,6 @@ module Paygate class Configuration - MODES = %i(live sandbox).freeze + MODES = %i[live sandbox].freeze attr_reader :mode @@ -9,8 +9,9 @@ def initialize end def mode=(value) - fail 'Invalid mode. Value must be one of the following: :live, :sandbox' unless value && MODES.include?(value.to_sym) - @mode = value.to_sym + value = value.to_sym + fail 'Invalid mode. Value must be one of the following: :live, :sandbox' unless value && MODES.include?(value) + @mode = value end end end diff --git a/lib/paygate/response.rb b/lib/paygate/response.rb index acf6c44..6038660 100644 --- a/lib/paygate/response.rb +++ b/lib/paygate/response.rb @@ -10,14 +10,14 @@ def self.build_from_net_http_response(txn_type, response) r.body = response.body case txn_type - when :refund - r.json = JSON.parse response.body.gsub(/^callback\((.*)\)$/, '\1') if response.code.to_i == 200 - when :profile_pay - r.json = {} - response.body.split('&').each do |key_value_pair| - key_value_ary = key_value_pair.split('=') - r.json[key_value_ary[0]] = key_value_ary[1] - end + when :refund + r.json = JSON.parse response.body.gsub(/^callback\((.*)\)$/, '\1') if response.code.to_i == 200 + when :profile_pay + r.json = {} + response.body.split('&').each do |key_value_pair| + key_value_ary = key_value_pair.split('=') + r.json[key_value_ary[0]] = key_value_ary[1] + end end r end diff --git a/lib/paygate/version.rb b/lib/paygate/version.rb index 92cf18d..6e3da7d 100644 --- a/lib/paygate/version.rb +++ b/lib/paygate/version.rb @@ -1,3 +1,3 @@ module Paygate - VERSION = '0.1.11' + VERSION = '0.2.0' end diff --git a/paygate-ruby.gemspec b/paygate-ruby.gemspec index 8b66b38..0777471 100644 --- a/paygate-ruby.gemspec +++ b/paygate-ruby.gemspec @@ -15,8 +15,4 @@ Gem::Specification.new do |spec| spec.files = Dir.glob('{data,lib,vendor}/**/*') + %w[CHANGELOG.md LICENSE.txt README.md Rakefile] spec.test_files = Dir.glob('spec/**/*') spec.require_paths = ['lib'] - - spec.add_development_dependency 'bundler' - spec.add_development_dependency 'rake' - spec.add_development_dependency 'rspec' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0603392..1ada845 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,6 +3,8 @@ $LOAD_PATH.unshift File.dirname(__FILE__) require 'paygate-ruby' +require 'rspec' +require 'timecop' RSpec.configure do |config| config.mock_with :rspec diff --git a/spec/unit/aes_ctr_spec.rb b/spec/unit/aes_ctr_spec.rb new file mode 100644 index 0000000..75d4d5a --- /dev/null +++ b/spec/unit/aes_ctr_spec.rb @@ -0,0 +1,38 @@ +require_relative '../spec_helper' + +RSpec.describe Paygate::AesCtr do + let(:plaintext) { "This is a test message" } + let(:password) { "password" } + let(:num_bits) { 128 } + let(:encrypted_text) { "yACaHyMKGQCJtHL8KR0loRQOGV5zIjbGHltR8QL4\n" } + let(:invalid_num_bits) { 2560 } + + describe ".encrypt" do + before do + allow(Object).to receive(:rand).and_return(0.123456789) + end + + around do |example| + Timecop.freeze(Time.utc(2022, 1, 1)) { example.run } + end + + it "returns an encrypted text string" do + expect(Paygate::AesCtr.encrypt(plaintext, password, num_bits)).to eq(encrypted_text) + end + + it "returns an empty string if num_bits is invalid" do + expect(Paygate::AesCtr.encrypt(plaintext, password, invalid_num_bits)).to eq('') + end + end + + describe ".decrypt" do + it "returns a decrypted text string" do + decrypted_text = Paygate::AesCtr.decrypt(encrypted_text, password, num_bits) + expect(decrypted_text).to eq(plaintext) + end + + it "returns an empty string if num_bits is invalid" do + expect(Paygate::AesCtr.decrypt(encrypted_text, password, invalid_num_bits)).to eq('') + end + end +end diff --git a/spec/unit/aes_spec.rb b/spec/unit/aes_spec.rb new file mode 100644 index 0000000..31565fe --- /dev/null +++ b/spec/unit/aes_spec.rb @@ -0,0 +1,235 @@ +require_relative '../spec_helper' + +RSpec.describe Paygate::Aes do + let(:key_128) { '0123456789abcdef' } + let(:key_192) { '0123456789abcdef012345' } + let(:key_256) { '0123456789abcdef0123456789abcdef' } + + describe '.cipher' do + context 'when encrypting with 128-bit key' do + it 'encrypts the input correctly' do + input = '0123456789abcdef' + expected_output = '72727e881edcfd0100a718687909b565' + key_schedule = described_class.key_expansion(key_128.bytes) + output = described_class.cipher(input.bytes, key_schedule) + + expect(output.pack('c*').unpack('H*').first).to eq(expected_output) + end + end + + context 'when encrypting with 192-bit key' do + it 'encrypts the input correctly' do + input = '0123456789abcdef01234567' + expected_output = '943cb7b4f5ec4afcbd2973b72ba25e4a' + key_schedule = described_class.key_expansion(key_192.bytes) + output = described_class.cipher(input.bytes, key_schedule) + + expect(output.pack('c*').unpack('H*').first).to eq(expected_output) + end + end + + context 'when encrypting with 256-bit key' do + it 'encrypts the input correctly' do + input = '0123456789abcdef0123456789abcdef' + expected_output = 'f83c9a60dc0cdb98219f79d6d5db1635' + key_schedule = described_class.key_expansion(key_256.bytes) + output = described_class.cipher(input.bytes, key_schedule) + + expect(output.pack('c*').unpack('H*').first).to eq(expected_output) + end + end + end + + describe '.key_expansion' do + context 'when expanding a 128-bit key' do + let(:expected_schedule) do + [ + [48, 49, 50, 51], + [52, 53, 54, 55], + [56, 57, 97, 98], + [99, 100, 101, 102], + [114, 124, 1, 200], + [70, 73, 55, 255], + [126, 112, 86, 157], + [29, 20, 51, 251], + [138, 191, 14, 108], + [204, 246, 57, 147], + [178, 134, 111, 14], + [175, 146, 92, 245], + [193, 245, 232, 21], + [13, 3, 209, 134], + [191, 133, 190, 136], + [16, 23, 226, 125], + [57, 109, 23, 223], + [52, 110, 198, 89], + [139, 235, 120, 209], + [155, 252, 154, 172], + [153, 213, 134, 203], + [173, 187, 64, 146], + [38, 80, 56, 67], + [189, 172, 162, 239], + [40, 239, 89, 177], + [133, 84, 25, 35], + [163, 4, 33, 96], + [30, 168, 131, 143], + [170, 3, 42, 195], + [47, 87, 51, 224], + [140, 83, 18, 128], + [146, 251, 145, 15], + [37, 130, 92, 140], + [10, 213, 111, 108], + [134, 134, 125, 236], + [20, 125, 236, 227], + [193, 76, 77, 118], + [203, 153, 34, 26], + [77, 31, 95, 246], + [89, 98, 179, 21], + [93, 33, 20, 189], + [150, 184, 54, 167], + [219, 167, 105, 81], + [130, 197, 218, 68] + ] + end + + it 'returns the expected key schedule' do + key = key_128.bytes + schedule = described_class.key_expansion(key) + expect(schedule).to eq(expected_schedule) + end + end + + context 'when expanding a 192-bit key' do + let(:expected_schedule) do + [ + [48, 49, 50, 51], + [52, 53, 54, 55], + [56, 57, 97, 98], + [99, 100, 101, 102], + [48, 49, 50, 51], + [246, 18, 241, 55], + [194, 39, 199, 0], + [250, 30, 166, 98], + [153, 122, 195, 4], + [169, 75, 241, 55], + [71, 179, 107, 228], + [133, 148, 172, 228], + [127, 138, 10, 134], + [230, 240, 201, 130], + [79, 187, 56, 181], + [169, 180, 190, 96], + [44, 32, 18, 132], + [83, 170, 24, 2], + [181, 90, 209, 128], + [250, 225, 233, 53], + [89, 170, 40, 77], + [117, 138, 58, 201], + [38, 32, 34, 203], + [147, 122, 243, 75], + [105, 155, 26, 126], + [93, 8, 219, 180], + [40, 130, 225, 125], + [14, 162, 195, 182], + [157, 216, 48, 253], + [244, 67, 42, 131], + [103, 237, 55, 11], + [79, 111, 214, 118], + [65, 205, 21, 192], + [220, 21, 37, 61], + [40, 86, 15, 190], + [150, 155, 153, 63], + [217, 244, 79, 73], + [152, 57, 90, 137], + [68, 44, 127, 180], + [108, 122, 112, 10], + [204, 202, 254, 111], + [21, 62, 177, 38], + [141, 7, 235, 175], + [201, 43, 148, 27], + [165, 81, 228, 17], + [6, 163, 124, 105], + [19, 157, 205, 79], + [158, 154, 38, 224] + ] + end + + it 'returns the expected key schedule' do + key = key_192.bytes + schedule = described_class.key_expansion(key) + expect(schedule).to eq(expected_schedule) + end + end + + context 'when expanding a 256-bit key' do + let(:expected_schedule) do + [ + [48, 49, 50, 51], + [52, 53, 54, 55], + [56, 57, 97, 98], + [99, 100, 101, 102], + [48, 49, 50, 51], + [52, 53, 54, 55], + [56, 57, 97, 98], + [99, 100, 101, 102], + [114, 124, 1, 200], + [70, 73, 55, 255], + [126, 112, 86, 157], + [29, 20, 51, 251], + [148, 203, 241, 60], + [160, 254, 199, 11], + [152, 199, 166, 105], + [251, 163, 195, 15], + [122, 82, 119, 199], + [60, 27, 64, 56], + [66, 107, 22, 165], + [95, 127, 37, 94], + [91, 25, 206, 100], + [251, 231, 9, 111], + [99, 32, 175, 6], + [152, 131, 108, 9], + [146, 2, 118, 129], + [174, 25, 54, 185], + [236, 114, 32, 28], + [179, 13, 5, 66], + [54, 206, 165, 72], + [205, 41, 172, 39], + [174, 9, 3, 33], + [54, 138, 111, 40], + [228, 170, 66, 132], + [74, 179, 116, 61], + [166, 193, 84, 33], + [21, 204, 81, 99], + [111, 133, 116, 179], + [162, 172, 216, 148], + [12, 165, 219, 181], + [58, 47, 180, 157], + [225, 39, 28, 4], + [171, 148, 104, 57], + [13, 85, 60, 24], + [24, 153, 109, 123], + [194, 107, 72, 146], + [96, 199, 144, 6], + [108, 98, 75, 179], + [86, 77, 255, 46], + [34, 49, 45, 181], + [137, 165, 69, 140], + [132, 240, 121, 148], + [156, 105, 20, 239], + [28, 146, 178, 77], + [124, 85, 34, 75], + [16, 55, 105, 248], + [70, 122, 150, 214], + [184, 161, 219, 239], + [49, 4, 158, 99], + [181, 244, 231, 247], + [41, 157, 243, 24] + ] + end + + it 'returns the expected key schedule' do + key = key_256.bytes + schedule = described_class.key_expansion(key) + expect(schedule).to eq(expected_schedule) + end + end + end +end