diff --git a/src/SHA.jl b/src/SHA.jl index 8aaae10b37760..fc2e32ecba56e 100644 --- a/src/SHA.jl +++ b/src/SHA.jl @@ -1,4 +1,4 @@ -#isdefined(Base, :__precompile__) && __precompile__() +isdefined(Base, :__precompile__) && __precompile__() module SHA @@ -40,12 +40,12 @@ for (f, ctx) in [(:sha1, :SHA1_CTX), # Our basic function is to process arrays of bytes function $f(data::Array{UInt8,1}) ctx = $ctx() - update!(ctx, data); + update!(ctx, data) return digest!(ctx) end - # ByteStrings are a pretty handy thing to be able to crunch through - $f(str::ByteString) = $f(str.data) + # AbstractStrings are a pretty handy thing to be able to crunch through + $f(str::AbstractString) = $f(convert(Array{UInt8,1}, str)) # Convenience function for IO devices, allows for things like: # open("test.txt") do f diff --git a/src/sha1.jl b/src/sha1.jl index 6094f5563efc9..f38d1267893b0 100644 --- a/src/sha1.jl +++ b/src/sha1.jl @@ -90,4 +90,4 @@ function transform!(context::SHA1_CTX) context.state[3] += c context.state[4] += d context.state[5] += e -end \ No newline at end of file +end