diff --git a/.travis.yml b/.travis.yml index 474db11..5eea8bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ os: - linux # - osx julia: - - 0.7 - 1.0 - 1.3 - nightly diff --git a/Project.toml b/Project.toml index 0a54108..4cfdbc1 100644 --- a/Project.toml +++ b/Project.toml @@ -3,12 +3,13 @@ uuid = "33c8b6b6-d38a-422a-b730-caa89a2f386c" version = "0.1.0" [deps] +Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" -SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce" UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" [compat] -julia = "0.7, 1" +Compat = "3.2" +julia = "1" [extras] Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" diff --git a/src/ProgressLogging.jl b/src/ProgressLogging.jl index ed5e65b..2debc85 100644 --- a/src/ProgressLogging.jl +++ b/src/ProgressLogging.jl @@ -6,33 +6,10 @@ module ProgressLogging export @progress, @progressid, @withprogress, @logprogress using Base.Meta: isexpr +using Compat: uuid5 # for Julia 1.0 using UUIDs: UUID, uuid4 using Logging: Logging, @logmsg, LogLevel -if VERSION >= v"1.1-" - using UUIDs: uuid5 -else - import SHA - function uuid5(ns::UUID, name::String) - nsbytes = zeros(UInt8, 16) - nsv = ns.value - for idx in Base.OneTo(16) - nsbytes[idx] = nsv >> 120 - nsv = nsv << 8 - end - hash_result = SHA.sha1(append!(nsbytes, convert(Vector{UInt8}, codeunits(unescape_string(name))))) - # set version number to 5 - hash_result[7] = (hash_result[7] & 0x0F) | (0x50) - hash_result[9] = (hash_result[9] & 0x3F) | (0x80) - v = zero(UInt128) - #use only the first 16 bytes of the SHA1 hash - for idx in Base.OneTo(16) - v = (v << 0x08) | hash_result[idx] - end - return UUID(v) - end -end - const ProgressLevel = LogLevel(-1) """