Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2891600
PhutilHashingIterator.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
757 B
Referenced Files
None
Subscribers
None
PhutilHashingIterator.php
View Options
<?php
final
class
PhutilHashingIterator
extends
PhutilProxyIterator
implements
Iterator
{
private
$hash
;
private
$algorithm
;
public
function
setAlgorithm
(
$algorithm
)
{
$this
->
algorithm
=
$algorithm
;
return
$this
;
}
public
function
getAlgorithm
(
)
{
return
$this
->
algorithm
;
}
public
function
getHash
(
)
{
$hash
=
$this
->
getHashResource
(
)
;
return
hash_final
(
$hash
,
$raw_output
=
false
)
;
}
protected
function
didReadValue
(
$value
)
{
$hash
=
$this
->
getHashResource
(
)
;
hash_update
(
$hash
,
$value
)
;
return
$value
;
}
private
function
getHashResource
(
)
{
if
(
!
$this
->
hash
)
{
$algorithm
=
$this
->
getAlgorithm
(
)
;
$this
->
hash
=
hash_init
(
$algorithm
)
;
}
return
$this
->
hash
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 15:27 (3 w, 23 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1114202
Default Alt Text
PhutilHashingIterator.php (757 B)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment