diff --git a/src/DitStr.jl b/src/DitStr.jl index ded4369..6750788 100644 --- a/src/DitStr.jl +++ b/src/DitStr.jl @@ -64,7 +64,7 @@ Base.zero(::Type{DitStr{D,N,T}}) where {D,N,T} = DitStr{D,N,T}(zero(T)) Base.zero(::DitStr{D,N,T}) where {D,N,T} = DitStr{D,N,T}(zero(T)) buffer(b::DitStr) = b.buf -Base.hash(d::DitStr) = hash(buffer(d)) +Base.hash(d::DitStr, h::UInt) = hash(buffer(d), h) Base.reinterpret(::Type{DitStr{D,N,T}}, x::Integer) where {D,N,T} = DitStr{D,N,T}(reinterpret(T, x)) Base.reinterpret(::Type{T}, x::DitStr) where {T} = reinterpret(T, buffer(x)) Base.reinterpret(::Type{DitStr{D,N,T}}, x::DitStr) where {D,N,T} = DitStr{D,N,T}(x) diff --git a/src/longlonguint.jl b/src/longlonguint.jl index 14113c6..ad19b2f 100644 --- a/src/longlonguint.jl +++ b/src/longlonguint.jl @@ -212,8 +212,8 @@ function longinttype(n::Int, D::Int) return LongLongUInt{C} end -Base.hash(x::LongLongUInt{1}) = hash(x.content[1]) -Base.hash(x::LongLongUInt{C}) where{C} = hash(x.content) +Base.hash(x::LongLongUInt{1}, h::UInt) = hash(x.content[1], h) +Base.hash(x::LongLongUInt{C}, h::UInt) where{C} = hash(x.content, h) # these APIs will are used in SparseTN BitBasis.log2i(x::LongLongUInt{C}) where C = floor(Int, log2(Float64(BigInt(x))))