Elgg\Database\UsersTable::generateInviteCode PHP Method

generateInviteCode() public method

Generates a unique invite code for a user
See also: validateInviteCode
public generateInviteCode ( string $username ) : string
$username string The username of the user sending the invitation
return string Invite code
    public function generateInviteCode($username)
    {
        $time = $this->getCurrentTime()->getTimestamp();
        return "{$time}." . _elgg_services()->crypto->getHmac([(int) $time, $username])->getToken();
    }