Add Crypt based password functions

This commit is contained in:
2025-01-18 21:47:49 +11:00
parent d3d7881e3b
commit 2445cac6a6
14 changed files with 180 additions and 938 deletions

View File

@@ -49,7 +49,7 @@ final class Password extends Attribute
$hash = Arr::get($m,1,'*clear*');
if (($potential=static::helpers()->filter(fn($hasher)=>str_starts_with($hasher::id(),$hash)))->count() > 1) {
if (($potential=static::helpers()->filter(fn($hasher)=>str_starts_with($hasher::key,$hash)))->count() > 1) {
foreach ($potential as $item) {
if ($item::subid($password))
return new $item;
@@ -82,7 +82,7 @@ final class Password extends Attribute
->with('edit',$edit)
->with('old',$old)
->with('new',$new)
->with('helpers',static::helpers()->map(fn($item,$key)=>['id'=>$key,'value'=>$key]));
->with('helpers',static::helpers()->map(fn($item,$key)=>['id'=>$key,'value'=>$key])->sort());
}
public function render_item_old(int $key): ?string