43 $portalName = $this->portalName ??
'';
45 $datePart = $this->date
47 ->format(self::DATE_PART_FORMAT)
50 $postfix = md5((
string)time(). $this->userId);
52 $datePartLength = mb_strlen($datePart);
53 $portalNameLength = mb_strlen($portalName);
54 $hashLength = mb_strlen($postfix);
56 if (($datePartLength + $portalNameLength + $hashLength) > self::MAX_UID_LENGTH)
58 $allowableLength = self::MAX_UID_LENGTH - $datePartLength - $hashLength - self::CORRECT_LENGTH;
59 $portalName = substr($this->portalName, 0, $allowableLength);
62 return $datePart .
'-' . $postfix .
"@" . $portalName;