Refactor HashContext into an object.#660
Conversation
|
Base64-encoding makes sense |
|
Sorry, I was with my head in a different branch. This class does not support serialize. (Though I will use base64 for that branch.) |
|
Can one of the admins verify this patch? |
|
I'll pick this up to update it for PHP7 and propose an RFC for it. Will keep your name on the commit of course. |
|
I've rewritten this patch for PHP7 as master...sgolemon:pr-660 with a couple notable differences:
|
|
ping @sara, there are conflicts, I didn't look close, sorry if silly ... |
|
@krokjoe The conflicts are on @realityking's original PR (this diff), which is against PHP5. My rewrite of it is over at master...sgolemon:pr-660 |
|
Comment on behalf of pollita at php.net: To minimize confusion, I'm closing this PR. Please reference my branch (linked above) for the current patch. |
|
Also... @krakjoe, not @krokjoe :p |
|
@sgolemon Can you please also open a PR for your branch? Otherwise not possible to review. |
This is essentially #611 without adding methods to the object.
Tests all pass, one required modification as it relied on the output of var_dump. The B/C break is very small, code that relies on checking is_resource() fails and needs to be changed to also do ìnstanceof HashContext`.
The new class offers only
__construct()and a clone handler, everything else has to be done to he procedural API.HashContextcan also be serialized. Currently this is simply binary data. I wonder if this should be base64/base85 encoded?