Code Duplication    Length = 7-7 lines in 2 locations

htdocs/xoops_lib/Xmf/Random.php 2 locations

@@ 40-46 (lines=7) @@
37
     *
38
     * @return string hashed token
39
     */
40
    public static function generateOneTimeToken($hash = 'sha512', $bytes = 64)
41
    {
42
        $factory = new Factory;
43
        $generator = $factory->getLowStrengthGenerator();
44
        $token = hash($hash, $generator->generate($bytes));
45
        return $token;
46
    }
47
48
    /**
49
     * Create a medium strength key
@@ 59-65 (lines=7) @@
56
     *
57
     * @return string hashed token
58
     */
59
    public static function generateKey($hash = 'sha512', $bytes = 128)
60
    {
61
        $factory = new Factory;
62
        $generator = $factory->getMediumStrengthGenerator();
63
        $token = hash($hash, $generator->generate($bytes));
64
        return $token;
65
    }
66
}
67