Created
July 22, 2013 19:52
-
-
Save dlongley/6057047 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Change this: | |
function payswarm_hash($obj) { | |
// SHA-1 hash JSON | |
$options = array('format' => 'application/nquads'); | |
return 'urn:sha256:' . hash('sha256', jsonld_normalize($obj, $options)); | |
} | |
To this: | |
function payswarm_hash($obj) { | |
// SHA-1 hash JSON | |
$options = array('format' => 'application/nquads'); | |
$normalized = jsonld_normalize($obj, $options); | |
$fp = fopen('/tmp/somefiletologto.txt', 'a'); | |
fwrite($fp, "\nNORMALIZED:\n$normalized\n"); | |
fclose($fp); | |
return 'urn:sha256:' . hash('sha256', $normalized); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment