phone number

master
Charles Iliya Krempeaux 2021-11-22 08:48:48 -08:00
parent b8ede4166a
commit e729970554
32 changed files with 281 additions and 0 deletions

View File

@ -5,6 +5,7 @@ func (arb T) PhoneNumber() string {
var funcs []func()string = []func()string{ var funcs []func()string = []func()string{
arb.phonenumber_canada, arb.phonenumber_canada,
arb.phonenumber_egypt,
} }
fn := funcs[arb.randomness.Intn(len(funcs))] fn := funcs[arb.randomness.Intn(len(funcs))]

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_10thoframadan() string {
return arb.phonenumber_egypt_3_4("55")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_alexandria() string {
return arb.phonenumber_egypt_4_4("3")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_arish() string {
return arb.phonenumber_egypt_3_4("68")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_aswan() string {
return arb.phonenumber_egypt_3_4("97")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_asyut() string {
return arb.phonenumber_egypt_3_4("88")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_benha() string {
return arb.phonenumber_egypt_3_4("13")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_benisuef() string {
return arb.phonenumber_egypt_3_4("82")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_damanhur() string {
return arb.phonenumber_egypt_3_4("45")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_damietta() string {
return arb.phonenumber_egypt_3_4("57")
}

View File

@ -0,0 +1,40 @@
package arbitrary
func (arb T) phonenumber_egypt() string {
var funcs []func()string = []func()string{
arb.phonenumber_greatercairo,
arb.phonenumber_alexandria,
arb.phonenumber_arish,
arb.phonenumber_asyut,
arb.phonenumber_aswan,
arb.phonenumber_benha,
arb.phonenumber_benisuef,
arb.phonenumber_damanhur,
arb.phonenumber_damietta,
arb.phonenumber_faiyum,
arb.phonenumber_ismailia,
arb.phonenumber_kafrelsheikh,
arb.phonenumber_luxor,
arb.phonenumber_marsamatruh,
arb.phonenumber_mansoura,
arb.phonenumber_minya,
arb.phonenumber_monufia,
arb.phonenumber_newvalley,
arb.phonenumber_portsaid,
arb.phonenumber_qena,
arb.phonenumber_redsea,
arb.phonenumber_sohag,
arb.phonenumber_suez,
arb.phonenumber_tanta,
arb.phonenumber_eltor,
arb.phonenumber_zagazig,
arb.phonenumber_10thoframadan,
arb.phonenumber_qalyubia,
}
fn := funcs[arb.randomness.Intn(len(funcs))]
return fn()
}

View File

@ -0,0 +1,36 @@
package arbitrary
import (
"fmt"
)
func (arb T) phonenumber_egypt_3_4(areacode string) string {
var localpart1 int
{
localpart1 = arb.randomness.Intn(1000)
}
var localpart2 int
{
localpart2 = arb.randomness.Intn(10000)
}
var format string
{
var formats []string = []string{
"0%s-%03d-%04d",
"+20-%s-%03d-%04d",
}
format = formats[arb.randomness.Intn(len(formats))]
}
var result string
{
result = fmt.Sprintf(format, areacode, localpart1, localpart2)
}
return result
}

View File

@ -0,0 +1,36 @@
package arbitrary
import (
"fmt"
)
func (arb T) phonenumber_egypt_4_4(areacode string) string {
var localpart1 int
{
localpart1 = arb.randomness.Intn(10000)
}
var localpart2 int
{
localpart2 = arb.randomness.Intn(10000)
}
var format string
{
var formats []string = []string{
"0%s-%04d-%04d",
"+20-%s-%04d-%04d",
}
format = formats[arb.randomness.Intn(len(formats))]
}
var result string
{
result = fmt.Sprintf(format, areacode, localpart1, localpart2)
}
return result
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_eltor() string {
return arb.phonenumber_egypt_3_4("69")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_faiyum() string {
return arb.phonenumber_egypt_3_4("84")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_greatercairo() string {
return arb.phonenumber_egypt_4_4("2")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_ismailia() string {
return arb.phonenumber_egypt_3_4("64")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_kafrelsheikh() string {
return arb.phonenumber_egypt_3_4("47")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_luxor() string {
return arb.phonenumber_egypt_3_4("95")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_mansoura() string {
return arb.phonenumber_egypt_3_4("50")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_marsamatruh() string {
return arb.phonenumber_egypt_3_4("46")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_minya() string {
return arb.phonenumber_egypt_3_4("86")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_monufia() string {
return arb.phonenumber_egypt_3_4("48")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_newvalley() string {
return arb.phonenumber_egypt_3_4("92")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_portsaid() string {
return arb.phonenumber_egypt_3_4("66")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_qalyubia() string {
return arb.phonenumber_egypt_3_4("13")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_qena() string {
return arb.phonenumber_egypt_3_4("96")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_redsea() string {
return arb.phonenumber_egypt_3_4("65")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_sohag() string {
return arb.phonenumber_egypt_3_4("93")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_suez() string {
return arb.phonenumber_egypt_3_4("62")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_tanta() string {
return arb.phonenumber_egypt_3_4("40")
}

View File

@ -0,0 +1,6 @@
package arbitrary
func (arb T) phonenumber_zagazig() string {
return arb.phonenumber_egypt_3_4("55")
}