Module: Textus::Etag
- Defined in:
- lib/textus/etag.rb
Class Method Summary collapse
Class Method Details
.for_bytes(bytes) ⇒ Object
5 6 7 |
# File 'lib/textus/etag.rb', line 5 def self.for_bytes(bytes) "sha256:#{Digest::SHA256.hexdigest(bytes)}" end |
.for_file(path) ⇒ Object
9 10 11 |
# File 'lib/textus/etag.rb', line 9 def self.for_file(path) for_bytes(File.binread(path)) end |