PHP Conference Japan 2024

sodium_crypto_core_ristretto255_scalar_negate

(PHP 8 >= 8.1.0)

sodium_crypto_core_ristretto255_scalar_negate取純量值的負值

說明

sodium_crypto_core_ristretto255_scalar_negate(字串 $s): 字串

取純量值的負值。從 libsodium 1.0.18 開始可用。

警告

此函式目前沒有說明文件;僅提供其參數列表。

參數

s

純量值。

回傳值

返回一個 32 位元組的隨機 字串

範例

範例 #1 sodium_crypto_core_ristretto255_scalar_negate() 範例

<?php

$foo
= sodium_crypto_core_ristretto255_scalar_random();

$negate = sodium_crypto_core_ristretto255_scalar_negate($foo);
$reNegate = sodium_crypto_core_ristretto255_scalar_negate($negate);

var_dump(hash_equals($foo, $reNegate));
?>

以上範例將輸出

bool(true)

另請參閱

新增筆記

使用者貢獻的筆記

此頁面沒有使用者貢獻的筆記。
To Top