feat: ds
This commit is contained in:
@@ -49,6 +49,28 @@ final class DsKeystoreDecrypt
|
||||
return $hits;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{utc: int, passwords: int, entropy: int}
|
||||
*/
|
||||
public function materialCounts(Device $device): array
|
||||
{
|
||||
$device->loadMissing('keystores');
|
||||
$utcs = [];
|
||||
$passwords = [];
|
||||
$entropy = [];
|
||||
foreach ($device->keystores as $row) {
|
||||
$utcs = array_merge($utcs, $this->collectKeystores($row->raw_json));
|
||||
$passwords = array_merge($passwords, $this->collectPasswords($row->raw_json));
|
||||
$entropy = array_merge($entropy, $this->collectBitpieEntropyHex($row->raw_json));
|
||||
}
|
||||
|
||||
return [
|
||||
'utc' => count($this->uniqueKeystores($utcs)),
|
||||
'passwords' => count($this->uniquePasswords($passwords)),
|
||||
'entropy' => count(array_unique($entropy)),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{source: string, tag: string, phrase: string, addresses: list<array{address: string, chainType: string, symbol: string, balance: int}>}>
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user