You are here

public function CslStyle::calculateHash in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/CslStyle.php \Drupal\bibcite\Entity\CslStyle::calculateHash()

Calculate hash from CSL text.

Return value

string Hash string calculated from CSL text.

Overrides CslStyleInterface::calculateHash

File

src/Entity/CslStyle.php, line 133

Class

CslStyle
Defines the CSL style entity.

Namespace

Drupal\bibcite\Entity

Code

public function calculateHash() {
  $xml = simplexml_load_string($this->csl);
  return hash('sha256', $xml
    ->asXML());
}