Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Hashing;
4
 
5
use Illuminate\Contracts\Hashing\Hasher;
6
use Illuminate\Support\Manager;
7
 
8
/**
9
 * @mixin \Illuminate\Contracts\Hashing\Hasher
10
 */
11
class HashManager extends Manager implements Hasher
12
{
13
    /**
14
     * Create an instance of the Bcrypt hash Driver.
15
     *
16
     * @return \Illuminate\Hashing\BcryptHasher
17
     */
18
    public function createBcryptDriver()
19
    {
20
        return new BcryptHasher($this->config->get('hashing.bcrypt') ?? []);
21
    }
22
 
23
    /**
24
     * Create an instance of the Argon2i hash Driver.
25
     *
26
     * @return \Illuminate\Hashing\ArgonHasher
27
     */
28
    public function createArgonDriver()
29
    {
30
        return new ArgonHasher($this->config->get('hashing.argon') ?? []);
31
    }
32
 
33
    /**
34
     * Create an instance of the Argon2id hash Driver.
35
     *
36
     * @return \Illuminate\Hashing\Argon2IdHasher
37
     */
38
    public function createArgon2idDriver()
39
    {
40
        return new Argon2IdHasher($this->config->get('hashing.argon') ?? []);
41
    }
42
 
43
    /**
44
     * Get information about the given hashed value.
45
     *
46
     * @param  string  $hashedValue
47
     * @return array
48
     */
49
    public function info($hashedValue)
50
    {
51
        return $this->driver()->info($hashedValue);
52
    }
53
 
54
    /**
55
     * Hash the given value.
56
     *
57
     * @param  string  $value
58
     * @param  array  $options
59
     * @return string
60
     */
61
    public function make($value, array $options = [])
62
    {
63
        return $this->driver()->make($value, $options);
64
    }
65
 
66
    /**
67
     * Check the given plain value against a hash.
68
     *
69
     * @param  string  $value
70
     * @param  string  $hashedValue
71
     * @param  array  $options
72
     * @return bool
73
     */
74
    public function check($value, $hashedValue, array $options = [])
75
    {
76
        return $this->driver()->check($value, $hashedValue, $options);
77
    }
78
 
79
    /**
80
     * Check if the given hash has been hashed using the given options.
81
     *
82
     * @param  string  $hashedValue
83
     * @param  array  $options
84
     * @return bool
85
     */
86
    public function needsRehash($hashedValue, array $options = [])
87
    {
88
        return $this->driver()->needsRehash($hashedValue, $options);
89
    }
90
 
91
    /**
92
     * Get the default driver name.
93
     *
94
     * @return string
95
     */
96
    public function getDefaultDriver()
97
    {
98
        return $this->config->get('hashing.driver', 'bcrypt');
99
    }
100
}