mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-10 00:42:40 +01:00
Upgrade "arc upload" to use SHA256
Summary: Fixes T12464. Moves "arc upload" to SHA256 where applicable. Test Plan: Ran `arc upload` against a server with D17620 twice, saw it skip the actual upload the second time. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12464 Differential Revision: https://secure.phabricator.com/D17622
This commit is contained in:
parent
c4e84550fc
commit
a59cfca5f1
1 changed files with 14 additions and 2 deletions
|
@ -346,11 +346,23 @@ final class ArcanistFileDataRef extends Phobject {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function newFileHash($path) {
|
private function newFileHash($path) {
|
||||||
|
$hash = hash_file('sha256', $path, $raw_output = false);
|
||||||
|
|
||||||
|
if ($hash === false) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $hash;
|
||||||
|
}
|
||||||
|
|
||||||
private function newDataHash($data) {
|
private function newDataHash($data) {
|
||||||
|
$hash = hash('sha256', $data, $raw_output = false);
|
||||||
|
|
||||||
|
if ($hash === false) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $hash;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue