Compare commits

..

No commits in common. "5b0908e84236dc7a6f221e6bdfb68644404234fa" and "ee94c1a159e044a8cd9edd15e18cf1032818eec1" have entirely different histories.

3 changed files with 1 additions and 206 deletions

View File

@ -21,11 +21,6 @@ func HTMLFile() fs.File {
return Default.HTMLFile()
}
// InternetHostName returns an arbitrary Internet hostname.
func InternetHostName() string {
return Default.InternetHostName()
}
// NetAddr returns an arbitrary net.Addr.
func NetAddr() net.Addr {
return Default.NetAddr()
@ -41,7 +36,7 @@ func Password() string {
return Default.Password()
}
// PctEncoded returns an arbitrary pct-encoded.
// Password returns an arbitrary pct-encoded.
func PctEncoded() string {
return Default.PctEncoded()
}

View File

@ -1,44 +0,0 @@
package arbitrary
import (
"fmt"
"strings"
)
// InternetHostName returns an arbitrary Internet hostname.
func (arb T) InternetHostName() string {
var partchars string = "0123456789abcdefghijklmnopqrstuvwxyz"
var tld string = tlds[arb.randomness.Intn(len(tlds))]
var parts []string
{
var numparts int = 1 + arb.randomness.Intn(3)
for i:=0; i<numparts; i++ {
var part string
if arb.Bool() {
var partlen int = 1 + arb.randomness.Intn(63)
part = arb.String(partlen, partchars)
} else {
part = wordsEnglish[arb.randomness.Intn(len(wordsEnglish))]
if 0 == (arb.randomness.Int() % 10) {
part += fmt.Sprintf("-%d", arb.randomness.Intn(1000))
}
}
parts = append(parts, part)
}
}
parts = append(parts, tld)
return strings.Join(parts, ".")
}

156
tlds.go
View File

@ -1,156 +0,0 @@
package arbitrary
var tlds = []string{
"academy",
"accountant",
"accountants",
"active",
"actor",
"ads",
"adult",
"aero",
"africa",
"agency",
"amazon",
"analytics",
"apartments",
"app",
"apple",
"art",
"arpa",
"audible",
"author",
"auto",
"autos",
"baby",
"banana",
"band",
"bank",
"bbs",
"bio",
"black",
"blog",
"blue",
"boo",
"book",
"bot",
"call",
"camp",
"car",
"cars",
"chat",
"cherry",
"city",
"com",
"cool",
"click",
"computer",
"data",
"day",
"dev",
"directory",
"diy",
"dot",
"edu",
"fail",
"farm",
"fire",
"fish",
"free",
"fun",
"fyi",
"game",
"games",
"gov",
"green",
"group",
"int",
"help",
"here",
"host",
"info",
"kim",
"land",
"link",
"live",
"lol",
"meet",
"mil",
"monster",
"name",
"net",
"network",
"ninja",
"now",
"one",
"open",
"org",
"page",
"pay",
"phone",
"photo",
"photography",
"photos",
"pics",
"pictures",
"pizza",
"plus",
"post",
"pub",
"radio",
"read",
"red",
"report",
"rocks",
"room",
"run",
"save",
"science",
"select",
"show",
"site",
"social",
"software",
"solar",
"song",
"spot",
"store",
"stream",
"studio",
"style",
"sucks",
"support",
"talk",
"taxi",
"team",
"tech",
"technology",
"tel",
"tips",
"today",
"tools",
"top",
"town",
"toys",
"travel",
"trust",
"tube",
"video",
"vision",
"webcam",
"website",
"wedding",
"whoswho",
"wiki",
"win",
"work",
"works",
"world",
"wow",
"wtf",
"you",
"zero",
"zip",
"zone",
"xxx",
}