struct

Fluxion::Checksum

Inherits Struct < Value < Object

A digest a profile pins a remote artifact to. Constructing one normalizes the hex to lowercase; parse rejects anything that is not exactly the right number of hex digits so a truncated paste fails at validation rather than at download time.

Constants

HEX_PATTERN = /\A[0-9a-f]+\z/

Constructors

new(algorithm : ChecksumAlgorithm, value : String)
Source

Class methods

parse(algorithm : ChecksumAlgorithm, value : String) : Checksum | String

Returns the checksum, or a message explaining why the literal is not a usable digest. Callers turn that message into a Diagnostic.

Source

Instance methods

algorithm
Source
matches?(digest : String) : Bool
Source
to_s(io : IO) : Nil

Same as #inspect(io).

Source
value
Source