Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace App\Services; use SplFileInfo; class Helper { /** * Get a uniq..

Decoded Output download

<?php

namespace App\Services;

use SplFileInfo;

class Helper
{
    /**
     * Get a unique hash from a file path.
     * This hash can then be used as the Song record's ID.
     */
    public static function getFileHash(string $path): string
    {
        return md5(config('app.key') . $path);
    }

    public static function getModifiedTime(string|SplFileInfo $file): int
    {
        $file = is_string($file) ? new SplFileInfo($file) : $file;

        // Workaround for #344, where getMTime() fails for certain files with Unicode names on Windows.
        return attempt(static fn () => $file->getMTime()) ?? time();
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace App\Services;

use SplFileInfo;

class Helper
{
    /**
     * Get a unique hash from a file path.
     * This hash can then be used as the Song record's ID.
     */
    public static function getFileHash(string $path): string
    {
        return md5(config('app.key') . $path);
    }

    public static function getModifiedTime(string|SplFileInfo $file): int
    {
        $file = is_string($file) ? new SplFileInfo($file) : $file;

        // Workaround for #344, where getMTime() fails for certain files with Unicode names on Windows.
        return attempt(static fn () => $file->getMTime()) ?? time();
    }
}

Function Calls

None

Variables

None

Stats

MD5 bdebbae9d84de12d55575071ce3c60ab
Eval Count 0
Decode Time 97 ms