Supported Versions: PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8
Calculate the sha1 hash of a string
<?php sha1(string $string, bool $binary = false): string
<?php Carbon::now()->addMinutes(Config::get('auth.verification.expire', 60)),
[
'id' => $notifiable->getKey(),
'hash' => sha1($notifiable->getEmailForVerification()),
]
);
}
<?php public function getName()
{
return 'login_'.$this->name.'_'.sha1(static::class);
}
<?php public function getRecallerName()
{
return 'remember_'.$this->name.'_'.sha1(static::class);
}
<?php public function path($key)
{
$parts = array_slice(str_split($hash = sha1($key), 2), 0, 2);
return $this->directory.'/'.implode('/', $parts).'/'.$hash;
}
<?php public function taggedItemKey($key)
{
return sha1($this->tags->getNamespace()).':'.$key;
}
<?php public function mutexName()
{
return 'framework/schedule-'.sha1($this->description ?? '');
}
<?php protected function ensureOutputIsBeingCaptured()
{
if (is_null($this->output) || $this->output == $this->getDefaultOutput()) {
$this->sendOutputTo(storage_path('logs/schedule-'.sha1($this->mutexName()).'.log'));
}
}
<?php return $mutexNameResolver($this);
}
return 'framework'.DIRECTORY_SEPARATOR.'schedule-'.sha1($this->expression.$this->command);
}
<?php protected function ensureFacadeExists($alias)
{
if (is_file($path = storage_path('framework/cache/facade-'.sha1($alias).'.php'))) {
return $path;
}
<?php return false;
}
if (! hash_equals(sha1($this->user()->getEmailForVerification()), (string) $this->route('hash'))) {
return false;
}
<?php throw new RuntimeException('Unable to generate fingerprint. Route unavailable.');
}
return sha1(implode('|', array_merge(
$route->methods(),
[$route->getDomain(), $route->uri(), $this->ip()]
)));
}
<?php private function formatIdentifier($value)
{
return self::$shouldHashKeys ? sha1($value) : $value;
}
<?php protected function getHash($value)
{
$hash = strtoupper(sha1((string) $value));
$hashPrefix = substr($hash, 0, 5);
<?php public function testPutCreatesMissingDirectories()
{
$files = $this->mockFilesystem();
$hash = sha1('foo');
$contents = '0000000000';
$full_dir = __DIR__.'/'.substr($hash, 0, 2).'/'.substr($hash, 2, 2);
$files->expects($this->once())->method('makeDirectory')->with($this->equalTo($full_dir), $this->equalTo(0777), $this->equalTo(true));
<?php {
$files = $this->mockFilesystem();
$hash = sha1('O--L / key');
$filePath = __DIR__.'/'.substr($hash, 0, 2).'/'.substr($hash, 2, 2).'/'.$hash;
$ten9s = '9999999999'; // The "forever" time value.
$fileContents = $ten9s.serialize('gold');