#!/usr/bin/php 1 ){ slog("No new secret with $depth depth", 'cyclic-hash:new', 'update'); return 0; } /* [2] If hash have just been created (original depth = 1000) =========================================================*/ /* (1) Return new hash (from @next) */ $newhash = $next; /* (2) Hash @depth times = 1000 */ for( $d = 0 ; $d < 1000 ; $d++ ) $newhash = hash('sha512', $newhash); slog("New secret with $depth depth", 'cyclic-hash:new', 'update'); return $newhash; } echo cyclichash_new(); ?>