gonanp

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 3 Imported by: 0

README

GoNANP

Go Report Card Test

Generate North American Numbering Plan compatible phone numbers ex 7725059292

Install

go get github.com/DLzer/gonanp

Generator usage

import "github.com/DLzer/gonanp

number := gonanp.GenerateNanp()

Validator usage

import "github.com/DLzer/gonanp

number := 7725059292
isValid := gonanp.ValidateNanp(number)

Documentation

Overview

Package gonanp is a tiny package for generating North American Numbering Plan compatible phone numbers.

NANP numbers are ten digits in length The format for NANP are in the format NXX-NXX-XXXX, where N is any digit 2-9 and X is any digit 0-9. The first three digits are called the numbering plan area (NPA) code, often called simply the area code. The second three digits are called the central office code or prefix. The final four digits are called the line number.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateNanp

func GenerateNanp() string

GenerateNanp returns a string containing a valid NANP phone number

func ValidateNanp added in v1.0.0

func ValidateNanp(n string) bool

ValidateNanp accepts a NANP phone number string and returns a bool for validity

Types

This section is empty.

Jump to

Keyboard shortcuts

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