# phpman > perldoc > Crypt::PRNG::Sober128

## NAME
    [Crypt::PRNG::Sober128](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG%3A%3ASober128/markdown) - Cryptographically secure PRNG based on Sober128 (stream cipher)
    algorithm

## SYNOPSIS
       ### Functional interface:
       use [Crypt::PRNG::Sober128](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG%3A%3ASober128/markdown) qw(random_bytes random_bytes_hex random_bytes_b64 random_string random_string_from rand irand);

       $octets = [random_bytes(45)](https://www.chedong.com/phpMan.php/man/randombytes/45/markdown);
       $hex_string = [random_bytes_hex(45)](https://www.chedong.com/phpMan.php/man/randombyteshex/45/markdown);
       $base64_string = [random_bytes_b64(45)](https://www.chedong.com/phpMan.php/man/randombytesb64/45/markdown);
       $base64url_string = [random_bytes_b64u(45)](https://www.chedong.com/phpMan.php/man/randombytesb64u/45/markdown);
       $alphanumeric_string = [random_string(30)](https://www.chedong.com/phpMan.php/man/randomstring/30/markdown);
       $string = random_string_from('ACGT', 64);
       $floating_point_number_0_to_1 = rand;
       $floating_point_number_0_to_88 = [rand(88)](https://www.chedong.com/phpMan.php/man/rand/88/markdown);
       $unsigned_32bit_int = irand;

       ### OO interface:
       use [Crypt::PRNG::Sober128](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG%3A%3ASober128/markdown);

       $prng = [Crypt::PRNG::Sober128](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG%3A%3ASober128/markdown)->new;
       #or
       $prng = [Crypt::PRNG::Sober128](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG%3A%3ASober128/markdown)->new("some data used for seeding PRNG");

       $octets = $prng->[bytes(45)](https://www.chedong.com/phpMan.php/man/bytes/45/markdown);
       $hex_string = $prng->[bytes_hex(45)](https://www.chedong.com/phpMan.php/man/byteshex/45/markdown);
       $base64_string = $prng->[bytes_b64(45)](https://www.chedong.com/phpMan.php/man/bytesb64/45/markdown);
       $base64url_string = $prng->[bytes_b64u(45)](https://www.chedong.com/phpMan.php/man/bytesb64u/45/markdown);
       $alphanumeric_string = $prng->[string(30)](https://www.chedong.com/phpMan.php/man/string/30/markdown);
       $string = $prng->string_from('ACGT', 64);
       $floating_point_number_0_to_1 = rand;
       $floating_point_number_0_to_88 = [rand(88)](https://www.chedong.com/phpMan.php/man/rand/88/markdown);
       $unsigned_32bit_int = irand;

## DESCRIPTION
    Provides an interface to the Sober128 based pseudo random number generator

    All methods and functions are the same as for [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

## FUNCTIONS
  random_bytes
    See "random_bytes" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

  random_bytes_hex
    See "random_bytes_hex" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

  random_bytes_b64
    See "random_bytes_b64" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

  random_bytes_b64u
    See "random_bytes_b64u" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

  random_string
    See "random_string" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

  random_string_from
    See "random_string_from" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

  rand
    See "rand" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

  irand
    See "irand" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

## METHODS
  new
    See "new" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

  bytes
    See "bytes" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

  bytes_hex
    See "bytes_hex" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

  bytes_b64
    See "bytes_b64" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

  bytes_b64u
    See "bytes_b64u" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

  string
    See "string" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

  string_from
    See "string_from" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

  double
    See "double" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

  int32
    See "int32" in [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown).

## SEE ALSO
    *   [Crypt::PRNG](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APRNG/markdown)

    *   <<https://en.wikipedia.org/wiki/SOBER-128>>

