Created
October 28, 2019 17:05
-
-
Save lamorbidamacchina/0da778d9c21d93739d503bef780888f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function getBlindIndex($string) | |
{ | |
$index_key = base64_decode($this->index_key); | |
return bin2hex( | |
sodium_crypto_pwhash( | |
32, | |
$string, | |
$index_key, | |
SODIUM_CRYPTO_PWHASH_OPSLIMIT_MODERATE, | |
SODIUM_CRYPTO_PWHASH_MEMLIMIT_MODERATE | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment