Skip to content

Commit

Permalink
Merge pull request #18 from JuliaCrypto/ox/deprecate_copy
Browse files Browse the repository at this point in the history
Deprecate copy for deepcopy
  • Loading branch information
oxinabox authored Jan 5, 2024
2 parents c7927e3 + b503cd4 commit 9745b0c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "MD5"
uuid = "6ac74813-4b46-53a4-afec-0b5dc9d7885c"
version = "0.2.2"
version = "0.2.3"

[deps]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand Down
1 change: 1 addition & 0 deletions src/MD5.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export md5
include("constants.jl")
include("types.jl")
include("core.jl")
include("deprecated.jl")


# Our basic function is to process arrays of bytes
Expand Down
3 changes: 3 additions & 0 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using Base: @deprecate
import Base: copy
@deprecate copy(ctx::MD5_CTX) deepcopy(ctx)
1 change: 0 additions & 1 deletion src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ state_type(::Type{MD5_CTX}) = UInt32
blocklen(::Type{MD5_CTX}) = UInt64(64)

MD5_CTX() = MD5_CTX(copy(MD5_initial_hash_value), 0, zeros(UInt8, blocklen(MD5_CTX)), false)
Base.copy(ctx::T) where {T<:MD5_CTX} = T(copy(ctx.state), ctx.bytecount, copy(ctx.buffer))
Base.show(io::IO, ::MD5_CTX) = write(io, "MD5 hash state")
1 change: 1 addition & 0 deletions test/deprecated.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@test (@test_deprecated copy(MD5.MD5_CTX())) isa MD5.MD5_CTX
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ end

include("nettle.jl")
include("perf.jl")
include("deprecated.jl")

2 comments on commit 9745b0c

@oxinabox
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/98251

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.3 -m "<description of version>" 9745b0c376fbafc52ccbc5aa940d3ce0099766c1
git push origin v0.2.3

Please sign in to comment.