<?php
/* 哈希生成示例 */
常量 PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_INTERACTIVE = 534288;
常量 PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_INTERACTIVE = 16777216;
常量 PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_SENSITIVE = 33554432;
常量 PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_SENSITIVE = 1073741824;
$hash_str = sodium_crypto_pwhash_scryptsalsa208sha256_str('password123', PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_INTERACTIVE, PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_INTERACTIVE);
print_r($hash_str);
//输出: $7$C6..../....ZwhNJoHcE/5yzM05gk67R2IOAp9XjD3X2gTNRpUlg92$YBwEfrN19OUo9dZG7LPSanCmjwYg.JgOEN4E75qrXG6