Skip to content

Commit 9745b0c

Browse files
authored
Merge pull request #18 from JuliaCrypto/ox/deprecate_copy
Deprecate copy for deepcopy
2 parents c7927e3 + b503cd4 commit 9745b0c

File tree

6 files changed

+7
-2
lines changed

6 files changed

+7
-2
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "MD5"
22
uuid = "6ac74813-4b46-53a4-afec-0b5dc9d7885c"
3-
version = "0.2.2"
3+
version = "0.2.3"
44

55
[deps]
66
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

src/MD5.jl

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export md5
1010
include("constants.jl")
1111
include("types.jl")
1212
include("core.jl")
13+
include("deprecated.jl")
1314

1415

1516
# Our basic function is to process arrays of bytes

src/deprecated.jl

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
using Base: @deprecate
2+
import Base: copy
3+
@deprecate copy(ctx::MD5_CTX) deepcopy(ctx)

src/types.jl

-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ state_type(::Type{MD5_CTX}) = UInt32
1111
blocklen(::Type{MD5_CTX}) = UInt64(64)
1212

1313
MD5_CTX() = MD5_CTX(copy(MD5_initial_hash_value), 0, zeros(UInt8, blocklen(MD5_CTX)), false)
14-
Base.copy(ctx::T) where {T<:MD5_CTX} = T(copy(ctx.state), ctx.bytecount, copy(ctx.buffer))
1514
Base.show(io::IO, ::MD5_CTX) = write(io, "MD5 hash state")

test/deprecated.jl

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@test (@test_deprecated copy(MD5.MD5_CTX())) isa MD5.MD5_CTX

test/runtests.jl

+1
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ end
3030

3131
include("nettle.jl")
3232
include("perf.jl")
33+
include("deprecated.jl")

0 commit comments

Comments
 (0)