::Fetcher;
use Scalar::Util qw(blessed);
use List::Util qw(max);
use JSON::MaybeUTF8 qw(encode_json_utf8 decode_json_utf8);
use YAML::XS qw(DumpFile);
use Syntax::Keyword::Try;
our $VE
ce", qw/content verified error/)->@*;
$self->{_data}->{$source}->{content} = decode_json_utf8($content // '[]');
$self->{_data}->{$source}->{verified} = $verified // 0;
updated => $self->{_data}->{$source}->{updated} // 0,
content => encode_json_utf8($self->{_data}->{$source}->{content} // []),
verified => $self->{_data}->{$sourc
e Text::Trim qw(trim);
use Syntax::Keyword::Try;
use XML::Fast;
use Locale::Country;
use JSON qw(to_json);
use Digest::SHA qw(sha256_hex);
use Encode qw(encode);
use constant MAX_REDIRECT
a);
=cut
sub _create_hash {
my ($data) = @_;
# Convert the data to a JSON string
my $json_string = to_json(
$data,
{
canonical => 1,
utf8 =>
1
});
# Generate and return the SHA-256 hash
return sha256_hex($json_string);
}
1;