Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use naive hash fallback for BioSequence #244

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BioSequences"
uuid = "7e6ae17a-c86d-528c-b3b9-7f778a29fe59"
authors = ["Sabrina Jaye Ward <[email protected]>", "Jakob Nissen <[email protected]>"]
version = "3.0.1"
version = "3.0.2"

[deps]
BioSymbols = "3c28c6f8-a34d-59c4-9654-267d177fcfa9"
Expand Down
1 change: 1 addition & 0 deletions src/biosequence/biosequence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Base.isempty(x::BioSequence) = iszero(length(x))
Base.empty(::Type{T}) where {T <: BioSequence} = T(eltype(T)[])
Base.empty(x::BioSequence) = empty(typeof(x))
BitsPerSymbol(x::BioSequence) = BitsPerSymbol(Alphabet(typeof(x)))
Base.hash(s::BioSequence, x::UInt) = foldl((a, b) -> hash(b, a), s, init=x)

function Base.similar(seq::BioSequence, len::Integer=length(seq))
return typeof(seq)(undef, len)
Expand Down
3 changes: 3 additions & 0 deletions src/longsequences/hash.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
### This file is a part of BioJulia.
### License is MIT: https://github.com/BioJulia/BioSequences.jl/blob/master/LICENSE.md

# NB NOTE: This entire file is commented out until issue #243 is resolved
#=
const c1 = 0x87c37b91114253d5
const c2 = 0x4cf5ad432745937f

Expand Down Expand Up @@ -173,3 +175,4 @@ function Base.hash(seq::SeqOrView, seed::UInt64)

return h1
end
=#