Skip to content

Instantly share code, notes, and snippets.

@lamorbidamacchina
Created October 28, 2019 17:05
Show Gist options
  • Save lamorbidamacchina/0da778d9c21d93739d503bef780888f3 to your computer and use it in GitHub Desktop.
Save lamorbidamacchina/0da778d9c21d93739d503bef780888f3 to your computer and use it in GitHub Desktop.
<?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