<?php

namespace App\Helpers;

class OpenCartPassword
{
    public static function hash($password, $salt)
    {
        return sha1($salt . sha1($salt . sha1($password)));
    }

    public static function verify($inputPassword, $storedHash, $salt)
    {
        $sha1Hash = self::hash($inputPassword, $salt);
        $md5Hash = md5($inputPassword);

        return $sha1Hash === $storedHash || $md5Hash === $storedHash;
    }
}