mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
encrypt download url
This commit is contained in:
@@ -254,4 +254,23 @@ class TorrentRepository extends BaseRepository
|
||||
return "$speed/s";
|
||||
}
|
||||
|
||||
public function encryptDownHash($id, $uid): string
|
||||
{
|
||||
$toolRep = new ToolRepository();
|
||||
$payload = [
|
||||
'id' => $id,
|
||||
'uid' => $uid,
|
||||
'date' => date('Ymd'),
|
||||
];
|
||||
return $toolRep->getEncrypter()->encrypt($payload);
|
||||
}
|
||||
|
||||
public function decryptDownHash($downHash)
|
||||
{
|
||||
$toolRep = new ToolRepository();
|
||||
return $toolRep->getEncrypter()->decrypt($downHash);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user