MCPcopy Create free account
hub / github.com/error311/FileRise / isEncryptedFile

Method isEncryptedFile

src/FileRise/Support/CryptoAtRest.php:167–185  ·  view source on GitHub ↗
(string $path)

Source from the content-addressed store, hash-verified

165 }
166
167 public static function isEncryptedFile(string $path): bool
168 {
169 $h = @fopen($path, 'rb');
170 if ($h === false) {
171 return false;
172 }
173 $magic = @fread($h, 4);
174 if (!is_string($magic) || strlen($magic) !== 4) {
175 @fclose($h);
176 return false;
177 }
178 if ($magic !== self::MAGIC) {
179 @fclose($h);
180 return false;
181 }
182 $ver = @fread($h, 1);
183 @fclose($h);
184 return (is_string($ver) && $ver !== '' && ord($ver) === self::VERSION);
185 }
186
187 /**
188 * @return array{plainSize:int, header:string}|null

Callers 12

encryptFileInPlaceMethod · 0.95
decryptFileInPlaceMethod · 0.95
encryptionJobTickMethod · 0.80
downloadFileMethod · 0.80
videoThumbnailMethod · 0.80
shareFileMethod · 0.80
createShareLinkMethod · 0.80
hasEncryptedFileMethod · 0.80
copyFilesMethod · 0.80
moveFilesMethod · 0.80
getSharedFileInfoMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected