Skip to content

Commit

Permalink
Reenable Crystal::Hasher seed randomisation on win32
Browse files Browse the repository at this point in the history
  • Loading branch information
RX14 authored and asterite committed Jan 13, 2018
1 parent 323613b commit d294dd1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/crystal/hasher.cr
Expand Up @@ -82,9 +82,7 @@ struct Crystal::Hasher
private HASH_INF_MINUS = (-314159_i64).unsafe_as(UInt64)

@@seed = uninitialized UInt64[2]
{% unless flag?(:win32) %}
Random::Secure.random_bytes(Slice.new(pointerof(@@seed).as(UInt8*), sizeof(typeof(@@seed))))
{% end %}
Random::Secure.random_bytes(Slice.new(pointerof(@@seed).as(UInt8*), sizeof(typeof(@@seed))))

def initialize(@a : UInt64 = @@seed[0], @b : UInt64 = @@seed[1])
end
Expand Down

0 comments on commit d294dd1

Please sign in to comment.