-
-
06 Nov 2021 09:26:22 UTC
- Distribution: CryptX
- Module version: 0.074
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues (1)
- Testers (1212 / 2 / 0)
- Kwalitee
Bus factor: 1- 65.94% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (1.57MB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Math::BigInt
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Crypt::PRNG::ChaCha20 - Cryptographically secure PRNG based on ChaCha20 (stream cipher) algorithm
SYNOPSIS
### Functional interface: use Crypt::PRNG::ChaCha20 qw(random_bytes random_bytes_hex random_bytes_b64 random_string random_string_from rand irand); $octets = random_bytes(45); $hex_string = random_bytes_hex(45); $base64_string = random_bytes_b64(45); $base64url_string = random_bytes_b64u(45); $alphanumeric_string = random_string(30); $string = random_string_from('ACGT', 64); $floating_point_number_0_to_1 = rand; $floating_point_number_0_to_88 = rand(88); $unsigned_32bit_int = irand; ### OO interface: use Crypt::PRNG::ChaCha20; $prng = Crypt::PRNG::ChaCha20->new; #or $prng = Crypt::PRNG::ChaCha20->new("some data used for seeding PRNG"); $octets = $prng->bytes(45); $hex_string = $prng->bytes_hex(45); $base64_string = $prng->bytes_b64(45); $base64url_string = $prng->bytes_b64u(45); $alphanumeric_string = $prng->string(30); $string = $prng->string_from('ACGT', 64); $floating_point_number_0_to_1 = rand; $floating_point_number_0_to_88 = rand(88); $unsigned_32bit_int = irand;
DESCRIPTION
Provides an interface to the ChaCha20 based pseudo random number generator
All methods and functions are the same as for Crypt::PRNG.
FUNCTIONS
random_bytes
See "random_bytes" in Crypt::PRNG.
random_bytes_hex
See "random_bytes_hex" in Crypt::PRNG.
random_bytes_b64
See "random_bytes_b64" in Crypt::PRNG.
random_bytes_b64u
See "random_bytes_b64u" in Crypt::PRNG.
random_string
See "random_string" in Crypt::PRNG.
random_string_from
See "random_string_from" in Crypt::PRNG.
rand
irand
METHODS
new
See "new" in Crypt::PRNG.
bytes
bytes_hex
See "bytes_hex" in Crypt::PRNG.
bytes_b64
See "bytes_b64" in Crypt::PRNG.
bytes_b64u
See "bytes_b64u" in Crypt::PRNG.
string
string_from
See "string_from" in Crypt::PRNG.
double
int32
SEE ALSO
Module Install Instructions
To install CryptX, copy and paste the appropriate command in to your terminal.
cpanm CryptX
perl -MCPAN -e shell install CryptX
For more information on module installation, please visit the detailed CPAN module installation guide.