Skip to content

Commit

Permalink
use SHA1
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Nov 1, 2021
1 parent ad7667f commit 2681963
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,12 @@ Base.:(==)(t1::Project, t2::Project) = all(x -> (getfield(t1, x) == getfield(t2,
Base.hash(t::Project, h::UInt) = foldr(hash, [getfield(t, x) for x in fieldnames(Project)], init=h)

# only hash the deps and compat fields as they are the only fields that affect a resolve
project_resolve_hash(t::Project, h::UInt = UInt(0)) = string(foldr(hash, [t.deps, t.compat], init=h))

function project_resolve_hash(t::Project, h::UInt = UInt(0))
iob = IOBuffer()
println(iob, t.deps)
println(iob, t.compat)
return bytes2hex(sha1(seekstart(iob)))
end

Base.@kwdef mutable struct PackageEntry
name::Union{String,Nothing} = nothing
Expand Down

0 comments on commit 2681963

Please sign in to comment.