()
| 554 | } |
| 555 | |
| 556 | func (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 | |
| 568 | func (u *UserRecord) SetCharacterName(cn string) error { |
| 569 |
no test coverage detected