phonenumber

package
v0.40.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LetterToNumberMap

func LetterToNumberMap() map[string]int

func LocalNumberUS

func LocalNumberUS(ac uint16, ln uint16) uint64

LocalNumberUS returns a US E.164 number given an areacode and line number

func StringToNumbers

func StringToNumbers(s string) string

Types

type AreaCodeIncrementor

type AreaCodeIncrementor struct {
	Counter map[uint16]uint16
	Base    uint16
}

func NewAreaCodeIncrementor

func NewAreaCodeIncrementor(base uint16) AreaCodeIncrementor

func (*AreaCodeIncrementor) GetNext

func (aci *AreaCodeIncrementor) GetNext(ac uint16) uint64

type FakeNumberGenerator

type FakeNumberGenerator struct {
	AreaCodes []uint16
	Rand      randutil.CryptoRand
}

func NewFakeNumberGenerator

func NewFakeNumberGenerator(areacodes []uint16) FakeNumberGenerator

func (*FakeNumberGenerator) LocalNumberUS

func (fng *FakeNumberGenerator) LocalNumberUS(ac uint16, ln uint16) uint64

LocalNumberUS returns a US E.164 number given an areacode and line number

func (*FakeNumberGenerator) RandomAreaCode

func (fng *FakeNumberGenerator) RandomAreaCode() uint16

RandomAreaCode generates a random area code.

func (*FakeNumberGenerator) RandomLineNumber

func (fng *FakeNumberGenerator) RandomLineNumber() uint16

RandomLineNumber generates a random line number

func (*FakeNumberGenerator) RandomLineNumberMinMax

func (fng *FakeNumberGenerator) RandomLineNumberMinMax(min, max uint16) uint16

RandomLineNumber generates a random line number

func (*FakeNumberGenerator) RandomLocalNumberUS

func (fng *FakeNumberGenerator) RandomLocalNumberUS() uint64

RandomLocalNumberUS returns a US E.164 number AreaCode + Prefix + Line Number

func (*FakeNumberGenerator) RandomLocalNumberUSAreaCodes

func (fng *FakeNumberGenerator) RandomLocalNumberUSAreaCodes(acs []uint16) uint64

RandomLocalNumberUS returns a US E.164 number AreaCode + Prefix + Line Number

func (*FakeNumberGenerator) RandomLocalNumberUSUnique

func (fng *FakeNumberGenerator) RandomLocalNumberUSUnique(set map[uint64]int8) (uint64, map[uint64]int8)

RandomLocalNumberUSUnique returns a US E.164 number AreaCode + Prefix + Line Number

func (*FakeNumberGenerator) RandomLocalNumberUSUniqueAreaCodeSet

func (fng *FakeNumberGenerator) RandomLocalNumberUSUniqueAreaCodeSet(set map[uint64]int8, acs []uint16) (uint64, map[uint64]int8)

RandomLocalNumberUSUnique returns a US E.164 number AreaCode + Prefix + Line Number

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL