Skip to content

Commit

Permalink
#827 securerandom
Browse files Browse the repository at this point in the history
  • Loading branch information
davvd committed Dec 7, 2023
1 parent e8596ec commit d74de21
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/zold/id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# SOFTWARE.

require 'csv'
require 'securerandom'

# The ID of the wallet.
# Author:: Yegor Bugayenko ([email protected])
Expand All @@ -38,7 +39,7 @@ class Id

def self.generate_id
loop do
id = format('%016x', rand((2**32)..(2**64) - 1))
id = SecureRandom.hex(8)
next if Id::BANNED.include?(id)
return id
end
Expand Down

0 comments on commit d74de21

Please sign in to comment.