You are here

public function CslStyle::calculateHash in Bibliography & Citation 2.0.x

Same name and namespace in other branches
  1. 8 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());
}