MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / TempName

Method TempName

internal/users/userrecord.go:556–566  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

554}
555
556func (u *UserRecord) TempName() string {
557 hasher := md5.New()
558 hasher.Write([]byte([]byte(u.Username)))
559 hashInBytes := hasher.Sum(nil)
560 number := new(big.Int).SetBytes(hashInBytes)
561
562 mod := new(big.Int)
563 mod.SetInt64(9087919)
564
565 return fmt.Sprintf("nameless-%d", number.Mod(number, mod).Int64())
566}
567
568func (u *UserRecord) SetCharacterName(cn string) error {
569

Callers 3

SetUsernameMethod · 0.95
characterCommandMethod · 0.80
StartFunction · 0.80

Calls 2

NewMethod · 0.80
WriteMethod · 0.65

Tested by

no test coverage detected