-2
我想在laravel中使用sha1哈希某些字符串。但不管字符串是什麼,它們都返回相同的散列。請,我需要知道爲什麼是這樣,或者我做錯了什麼。見下面我的代碼:在Laravel中使用SHA 1哈希
$lice = $serial->sname.$serial->company.$serial->effDate.$serial->ltype;
//$serial->sname is MTS;
//$serial->company is Godowns Technology;
//$serial->effDate is 2017-01-24;
//$serial->ltype is Trial
$lice2= sha1($lice);
$lice3 = chunk_split($lice2,5,'-');
$lice4 =strtoupper($lice3);
based on the information above, the $lice4 is always return:
DA39A-3EE5E-6B4B0-D3255-BFEF9-56018-90AFD-80709
請,我需要在這
挑戰的第一個假設是'$ lice'設置正確。如果哈希結果總是相同,那麼壓倒性的最可能的情況是哈希值總是相同的。 – patricus
這是一個空字符串的sha1-hash。 – Dilaz
@Dilaz:這是否意味着變量沒有被提取?這就是爲什麼它是哈希空字符串 – Dave