Does Java SecureRandom.nextLong() return all possible values given it inherits from Random which uses only 48 bits? If not, can I still do it in Java maybe by modifying the Random class and how to do it? I just want to use an all random long number generator where all possible long values can be returned, if possible.
How to generate all possible 64 bit random values in java?
1.3k views Asked by mj1261829 At
1
There are 1 answers
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in RANDOM
- Producing filtered random samples which can be replicated using the same seed
- Random getting value from a range or a specific value
- Unique and random selection of 10 rows per user in a table
- How to calculate the accuracy in number guessing game?
- Using attributes from instances of array of objects in other classes
- How do I write such a random source code generator?
- How to randomly load html file inside a html page on page load using javascript?
- New error on random number assigned to local variable , Rails
- Why does the code return the same 5 random numbers every time
- How can I efficiently find two numbers in an array that sum up to a given target without using the same element twice?
- How can I use a variable that is defined in one script in a different script in Unity
- Why is C# BigInteger not always the same bit length?
- Choosing a sequence of bitwise operations
- java: method nextLong in class java.util.Random cannot be applied to given types;
- How to add the outout the random element from array and keep adding 1 by 1 in empty array?
Related Questions in GENERATOR
- How to schedule the execution of broadcast tasks from a queue of to be broadcasted data with a one second delay in between each broadcast invocation?
- new initializer expression list treated as compound expression [-fpermissive]
- pysnmp-lextudio using next() with the getCmd() generator leads to TypeError: 'tuple' object is not an iterator
- how can i Automate documentation in my CI/CD pipeline or through my project workflow (java) ? documentation generator for the whole process?
- Is there a possibility to generate sitemap.xml in SPA React project?
- How can I write a streaming tar file from a generator?
- Relationshipt between async/await, generators and coroutines
- My decorator does not work when I run the program
- The authorization system in the application and the transition to another page
- Why generators don't raise StopIteration exception when called through pytest?
- How to do a nested loop over a variable length list of generators?
- using batches results in errors (3D or 4D tensor expected for input, expected input to have 9 channels, but got 4 channels )
- Why did adding 'Jane' with an age of 35 result in two entries ('name' and 'age') instead of one?
- TS1163: Typescript wont allow yield within functions
- what exactly is returned when `return_as="generator"` is in `joblib.Parallel`?
Related Questions in LONG-INTEGER
- Need large integers and floats. Trouble with long long int and long double
- SQLBindCol for long integer value on 64Bit platform?
- will there be overflow or not in this case
- How do I make a sorted, long compression data structure?
- Facing issue while converting 18 digit double value to long
- best way to recognize and handle integer overflow in c?
- How to compress a strictly increasing sequence of Longs
- Why this error happens: SUMMARY: AddressSanitizer: heap-buffer-overflow
- Challenge of Translating Python Code to C: Implementing Luhn Algorithm for Checksum Calculation
- Using pivot_longer in R in Kaggle, producing NAs for second half of data
- Why does this code overflows even when casting?
- How do I fix my unit converter in python?
- Compare int with leading zero int
- Word width before and after multiplication
- Unable to get percentage with 'int' even though value is within range. Works with 'long' though. Why?
Related Questions in SECURE-RANDOM
- Use a dynamically-generated, random IV | SecureRandom unable to decrypt the encrypted values
- Does the KeyPairGenerator class behave differently in Java 1.6 and Java 1.8?
- How to properly use SecureRandom 12 digit number?
- How to implement RSA based on custom user defined padding -JAVA
- How to use SecureRandom instead of using hardcoded bytes array for Java AES Encrytion and Decryption?
- RandomUUID in UUID operators code explanation
- How can we generate Random Salt of 32 bytes in Rhino JS
- SecureRandom is unreasonably slow or freezes the system
- Java RNG - How to print out which secure random file being used from OS?
- SecureRandom Sha1Prng throws Unsupported Operation Exception
- Java SecureRandom Instance SHA1PRNG equivalent in Node.JS/
- How to access SecureRandom in jsbn typescript?
- SecureRandom is not working as expected in docker adoptopenjdk-tomcat image
- Generating unique random values with SecureRandom
- How to generate a SecureRandom number with a specific bit range
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
While SecureRandom inherits from Random, it doesn't use the same maths or have the same limitation. It will produce all possible 64-bit values eventually.
This class delegates to one of many possible implementations. You can select one by calling
SecureRandom.getInstance(algorithm)Note: some implementations use entropy in your computer to make the results random, rather than purely pseudo random.
SecureRandom doesn't use any of the methods of it's parent e.g.
This method delegates to a completely different implementation.
Related link How to solve slow Java `SecureRandom`? due to using /dev/random