mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-26 22:02:13 +09:00
Improve anonymous nickname to generate random number per date and document.
https://www.xetown.com/qna/745244
This commit is contained in:
parent
5138a765d4
commit
f75efa1b5d
2 changed files with 7 additions and 1 deletions
|
|
@ -742,6 +742,12 @@ class boardController extends board
|
|||
$num = sprintf('%08d', hexdec(substr($num, 0, 8)) % 100000000);
|
||||
return strtr($format, array('$DOCNUM' => $num));
|
||||
}
|
||||
elseif (strpos($format, '$DOCDAILYNUM') !== false)
|
||||
{
|
||||
$num = hash_hmac('sha256', ($member_srl ?: \RX_CLIENT_IP) . ':document_srl:' . $document_srl . ':date:' . date('Y-m-d'), config('crypto.authentication_key'));
|
||||
$num = sprintf('%08d', hexdec(substr($num, 0, 8)) % 100000000);
|
||||
return strtr($format, array('$DOCDAILYNUM' => $num));
|
||||
}
|
||||
else
|
||||
{
|
||||
return $format;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue