module Etag

Extended Modules

Defined in:

Constant Summary

VERSION = "0.1.0"

Instance Method Summary

Instance Method Detail

def etag(entity : String, *, weak = false, force = false) : String #

Generate tag based on file entity

Etag.etag File.read("./README.md")
# => "\"a19-UDMQYeZ+VMk+2Fv11x6Mu/JkktE\""

# or weak

Etag.etag File.read("./README.md")
# => "W/\"a19-UDMQYeZ+VMk+2Fv11x6Mu/JkktE\""

def etag(stat : File::Stat, *, weak = false) : String #

Generate tag based on file stat

Etag.etag File.lstat("./README.md")
# => "\"a19-582e0568"\"

# or weak

Etag.etag File.lstat("./README.md", weak: true)
# => "W/\"a19-582e0568"\"