ParagonIE_Sodium_Compat::crypto_box_keypair()public staticWP 1.0

Generate a new random X25519 keypair.

{} Это метод класса: ParagonIE_Sodium_Compat{}

Хуков нет.


Строку. A 64-byte string; the first 32 are your secret key, while the last 32 are your public key. crypto_box_secretkey() and crypto_box_publickey() exist to separate them so you don't accidentally get them mixed up!


$result = ParagonIE_Sodium_Compat::crypto_box_keypair();

Код ParagonIE_Sodium_Compat::crypto_box_keypair() WP 6.0.2

public static function crypto_box_keypair()
    if (self::useNewSodiumAPI()) {
        return (string) sodium_crypto_box_keypair();
    if (self::use_fallback('crypto_box_keypair')) {
        return (string) call_user_func('\\Sodium\\crypto_box_keypair');
    if (PHP_INT_SIZE === 4) {
        return ParagonIE_Sodium_Crypto32::box_keypair();
    return ParagonIE_Sodium_Crypto::box_keypair();