Sha256: b1b5f6c389199af15cdffc22c89b67975e24068ade28b14a31195a057d4eef23
Contents?: true
Size: 609 Bytes
Versions: 27
Compression:
Stored size: 609 Bytes
Contents
# frozen_string_literal: true require "digest/sha2" require "murmurhash3" module Mihari class HTML attr_reader :path def initialize(path) @path = path end def exists? return false unless path File.exist? path end def sha256 Digest::SHA256.hexdigest data end def md5 Digest::MD5.hexdigest data end def mmh3 hash = MurmurHash3::V32.str_hash(data) if (hash & 0x80000000).zero? hash else -((hash ^ 0xFFFFFFFF) + 1) end end private def data File.read path end end end
Version data entries
27 entries across 27 versions & 1 rubygems