PHP8 sodium_crypto_core_ristretto255_scalar_negate

2024-03-16 10:10 更新

(PHP 8 >= 8.1.0)

sodium_crypto_core_ristretto255_scalar_negate — 否定標(biāo)量值

說(shuō)明

sodium_crypto_core_ristretto255_scalar_negate(string $s): string

否定標(biāo)量值。 從 libsodium 1.0.18 開始可用。

警告

本函數(shù)還未編寫文檔,僅有參數(shù)列表。

參數(shù) 

s

標(biāo)量值。

返回值

返回一個(gè) 32 字節(jié)的隨機(jī)字符串。

示例 

示例 #1 sodium_crypto_core_ristretto255_scalar_negate() example

<?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));
?>

以上示例會(huì)輸出:

bool(true)

參見 

  • sodium_crypto_core_ristretto255_scalar_random() - 生成一個(gè)隨機(jī)鍵


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)