Skip to content

Commit

Permalink
Use Random::Secure with Crystal::Hasher. (#5097)
Browse files Browse the repository at this point in the history
  • Loading branch information
akzhan authored and RX14 committed Oct 10, 2017
1 parent 885eda6 commit 2637f83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/crystal/hasher.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "crystal/system/random"
require "random/secure"

# :nodoc:
struct Crystal::Hasher
Expand All @@ -10,7 +10,7 @@ struct Crystal::Hasher
# another algorithm like SipHash or FNV.

@@seed = uninitialized UInt64
Crystal::System::Random.random_bytes(Slice.new(pointerof(@@seed).as(UInt8*), 8))
Random::Secure.random_bytes(Slice.new(pointerof(@@seed).as(UInt8*), 8))

property result : UInt64 = @@seed

Expand Down

0 comments on commit 2637f83

Please sign in to comment.