A high-entropy random number generation library
Project description
The English version of the README.md file was created by a translator. Therefore, the translation may not be accurate. If you can use Korean, we recommend that you view the Korean document. 한국어 문서 바로가기(korean)
Ranpick
Ranpick complements the shortcomings of the existing PRNG method and generates random numbers with nanoseconds and hash-based systems.
A system using text is also currently being developed.
Installation
-
Use 'pip' to install the lanpick:
pip install ranpick
-
Add the import statement below to the code (.py) to import the ranpick:
from Rankick import
-
The import statement below allows you to import all modules:
from ranpick import *
Modules and Use Guides
As of 2024.12.3 (KST), the modules currently available are as follows.
- number:
Produces a random number in the form of a number
number - Generating a numeric random number
Number generates a random number in the form of a normal number.
You can generate numbers up to 100000000.
The number module can be imported into the import statement below.
from ranpick import number
The basics
The number module can be used in the following ways.
random_number = ranpick.number() # random_number variable, store the random number (~100000000) that is selected as the random number module.
print(random_number) # print_number The value of the variable random_number.
print(ranpick.number()) #rampicknumber Outputs the value of the random number drawn by the module.
This is the basic method of using the number module. You can generate random numbers with ranpick.number().
Limiting the Number of Random Numbers
You can also limit the number of random numbers. The example code below limits random numbers to between 5 and 10.
limit_number = ranpick.number(5, 10)
print(limit_number)
print(ranpick.number(5, 10))
ranpick.number(5, 10) is a code that limits the number of random numbers to between 5 and 10. You can complete it by adding starting numbers, arriving numbers in ().
Calculations such as ' 2+3,10/2 can also be used to limit the number of random numbers and can be used in all the contents to be described later.
Set decimal place
By default, a generated random number can only be generated with integers. However, if you refer to the example below, you can output a small number of outputs.
decimal_number = ranpick.number(0, 1, d3)
print(decimal_number)
print(ranpick.number(0,1(d3))
This example code is a code that outputs numbers between 0 and 1 up to three decimal places. (d3) means that it outputs up to three decimal places.
If (d4) is used, it can be output up to four decimal places.
It can be up to 10 digits.
Application
The codes below are created by applying this module, other libraries, and modules. In addition to the examples used here, a variety of other libraries and applications are possible.
DataTime Library Application
Below is the code applied using the datetime library.
from ranpick import number
from datetime import datetime
date_number = int(datetime.now().strftime("%Y%m%d%H%M%S"))
print(ranpick.number(date_number, date_number × 10))
This code was made to output random numbers by leveraging the time output from the datetime library.
Ramdom Module Application
Below is the code applied using the random module.
from ranpick import number
import random
random_number = random.randint(1,10)
print(random_number, 100)
This code generates another random number by using the random number output from the random module. It can be applied to produce almost unpredictable random numbers.
However, using this type of code is not recommended because it requires a lot of resources on your computer.
Bug report
Please report bugs on the site below (github).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ranpick-1.0.0.tar.gz.
File metadata
- Download URL: ranpick-1.0.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8d0ba5f0ec04a38d3c5e687abaca8ba0c57a235a6a64222c7a7bbc6e4ad6b34
|
|
| MD5 |
5d9946cc833a162ffeff26afcda64cca
|
|
| BLAKE2b-256 |
d46160bbf7cd4afd27e0b9ccdc2ebd552b3de0ed71ede2c40a6c6da76a50b25b
|
File details
Details for the file ranpick-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ranpick-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9b1b0061ac42450138ce61b8b1d5c2eae1f6a4653ba39f0ed120a77473ee8b0
|
|
| MD5 |
ee2090347de023655d6d1fbd27f6069a
|
|
| BLAKE2b-256 |
6731091128a6db63d24b0544ce1bf47e6735635d2b942db5dc49d41734ca9b3b
|