nanoseconds and random numbers

Source: Internet
Author: User

Random is pseudo-random, that is, when the seed is determined, the sequence of stochastic numbers is determined.
So the seed is the key of the random number, if the constructor does not pass the seed, the secret exists in the value of nanotime, guess this value will be more difficult, 1 milliseconds =1k subtle =1m nanosecond =1b picosecond; If you can accurately predict the millisecond, the calculation of 1 million sequences must have a right, and if you use the specified seed , all the secrets are in that seed. The nanosecond number is a long, which can support a continuous count of 296 years.
It is foolish to specify a seed for the random.

Java has used this mentally retarded algorithm for portability, but if you ask for a high-securerandom, see the API documentation.

nanoseconds and random numbers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.