<?php

namespace App\Helpers;

use Illuminate\Support\Facades\DB;
use stdClass;

class HashesHelpers
{

    public static function findHashes(string $sha1 ): ?StdClass
    {
        return DB::connection('hashes')->table('hashes')->where('sha1', $sha1)->first();
    }

    public static function getReferenceName( int $id ): ?string
    {
        return DB::connection('hashes')->table('dat_reference')->where('id', $id)->first()?->name ?? null;
    }

}
