mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-02 19:52:44 +01:00
16 lines
319 B
PHP
16 lines
319 B
PHP
|
<?php
|
||
|
|
||
|
final class PhabricatorHash {
|
||
|
|
||
|
public static function digest($string) {
|
||
|
$key = PhabricatorEnv::getEnvConfig('security.hmac-key');
|
||
|
if (!$key) {
|
||
|
throw new Exception(
|
||
|
"Set a 'security.hmac-key' in your Phabricator configuration!");
|
||
|
}
|
||
|
|
||
|
return hash_hmac('sha1', $string, $key);
|
||
|
}
|
||
|
|
||
|
}
|