Skip to content

Instantly share code, notes, and snippets.

@johnxx
Created March 21, 2016 23:35
Show Gist options
  • Save johnxx/366afffa98ffc0b72463 to your computer and use it in GitHub Desktop.
Save johnxx/366afffa98ffc0b72463 to your computer and use it in GitHub Desktop.
protected function _generate_batch_guid() {
$algorithm = 'sha256';
$curtime = time();
$rand = openssl_random_pseudo_bytes(16);
$hash = hash($algorithm, "$this->to $this->body $curtime $rand");
$version = "1/";
return $version.$hash;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment