Reputation: 3632
What is the difference between functions getSeed()
and generateSeed()
in java's SecureRandom
class?
Both looks same except that getSeed()
returns static byte[]
and generateSeed()
returns only byte[]
.
Upvotes: 0
Views: 256
Reputation: 888047
See the documentation:
This method is only included for backwards compatibility. The caller is encouraged to use one of the alternative getInstance methods to obtain a SecureRandom object, and then call the generateSeed method to obtain seed bytes from that object.
Upvotes: 1
Reputation: 201507
The SecureRandom.getSeed(int)
JavaDoc explicitly says
This method is only included for backwards compatibility. The caller is encouraged to use one of the alternative
getInstance
methods to obtain a SecureRandom object, and then call thegenerateSeed
method to obtain seed bytes from that object.
Upvotes: 2