Ignore:
Timestamp:
Jun 1, 2023, 1:01:38 AM (12 months ago)
Author:
chronos
Message:
  • Fixed: Modules initialization.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/User/PasswordHash.php

    r8 r9  
    11<?php
     2
    23
    34class PasswordHash
    45{
    5   function Hash($Password, $Salt)
     6  function Hash(string $Password, string $Salt): string
    67  {
    78    return sha1(sha1($Password).$Salt);
    89  }
    910
    10   function Verify($Password, $Salt, $StoredHash)
     11  function Verify(string $Password, string $Salt, string $StoredHash): bool
    1112  {
    1213    return $this->Hash($Password, $Salt) == $StoredHash;
    1314  }
    1415
    15   function GetSalt()
     16  function GetSalt(): string
    1617  {
    17     mt_srand(microtime(true) * 100000 + memory_get_usage(true));
     18    mt_srand(intval(microtime(true)) * 100000 + memory_get_usage(true));
    1819    return sha1(uniqid(mt_rand(), true));
    1920  }
Note: See TracChangeset for help on using the changeset viewer.