protected function calculateDigest($xml)
    {
        $xml = $this->canonicalize($xml);
        $utf8 = utf8_encode($xml . $this->options['shared_secret']);

        return base64_encode(sha1($utf8, true));
    }