The setter for the attribute "checksum"

@param mixed $mixed

@return void
325772
public function setChecksum($mixed)
    {
        if (is_string($mixed)) {
            $data = [strtolower($mixed)];

            if (strpos($data[0], ',')) {
                $data = explode(',', $mixed);
            }

            $this->checksum = $data;
        } elseif ($mixed === true) {
            $this->checksum = ['md5'];
        }
    }
647310
public function setCode( $value )
	{
		$this->_checkCode( $value );

		$this->_values['code'] = (string) $value;
		$this->setModified();
	}
179933
public static function decodeWithChecksum($string, $errmode = self::NORMALIZE_ERRMODE_SILENT)
    {
        $checksum = substr($string, (strlen($string) -1), 1);
        $string = substr($string, 0, strlen($string) - 1);

        $value = static::internalDecode($string, $errmode);
        $checksumValue = static::internalDecode($checksum, self::NORMALIZE_ERRMODE_EXCEPTION, true);

        if ($checksumValue !== ($value % 37)) {
            throw new \RuntimeException("Checksum symbol '$checksum' is not correct value for '$string'");
        }

        return $value;
    }
237660
private static function normalize(&$val) : void
    {
        if (is_array($val)) {
            array_walk($val, [__CLASS__, 'normalize']);
        } elseif (is_scalar($val)) {
            $val = strlen($val) ? $val : null;
        }
    }
858757
private function setData($data) {
        $this->indcheck = $data[0];
        $this->data = $data[1];
        $this->calculateChecksum();
        $this->data[] = $this->code[$this->checksumValue];
        $this->data[] = $this->code[self::KEY_STOP];
    }
660569
public function parse($text) {
        $this->text = $text;
        $this->checksumValue = false; // Reset checksumValue
        $this->validate();

        parent::parse($text);

        $this->addDefaultLabel();
    }
707741
private function checksum($code)
	{
		$len = strlen($code);
		$sum = 0;
		for ($i = 0; $i < $len; $i += 2) {
			$sum += $code[$i];
		}
		$sum *= 3;
		for ($i = 1; $i < $len; $i += 2) {
			$sum += ($code[$i]);
		}
		$r = $sum % 10;
		if ($r > 0) {
			$r = (10 - $r);
		}
		return $r;
	}
221593
public function unserialize($value) : void
    {
        if (isset($this->numerator)) {
            throw new \LogicException('unserialize() is an internal function, it must not be called directly.');
        }

        [$numerator, $denominator] = \explode('/', $value);

        $this->numerator   = BigInteger::of($numerator);
        $this->denominator = BigInteger::of($denominator);
    }
956956
protected function checksum(FileInterface $entity)
    {
        $currentHash = $this->fileManager->checksumTemporaryFileByName($entity->getName());
        
        if ($entity->getHash() !== $currentHash){
            throw new FileHashChangedException($entity->getName());
        }
    }
363861
public function setHash($value)
    {
        $this->_validateNotNull('Hash', $value);
        $this->_validateString('Hash', $value);

        if ($this->data['hash'] === $value) {
            return;
        }

        $this->data['hash'] = $value;

        $this->_setModified('hash');
    }
1188064
private static function utf8_encode(&$mixed)
    {
        if (is_array($mixed) || is_object($mixed)) {
            foreach ($mixed as &$value) {
                self::utf8_encode($value);
            }
        } else {
            if (is_string($mixed)) {
                $mixed = utf8_encode($mixed);
            }
        }
    }
15801
function checksum(data) {
	var result = data.split('').map(function (n) {
		return +n;
	}).reduce(function (sum, a, idx) {
		return idx % 2 ? sum + a * 9 : sum + a * 3;
	}, 0);
	return result % 10;
}
429896
public function validateChecksum($data)
    {
        if (!isset($data['checksum']) || !$this->getEsiKey()) {
            return false;
        }

        $suppliedChecksum = $data['checksum'];
        unset($data['checksum']);
        return $suppliedChecksum === $this->getChecksum($data);
    }
931106
def __set_checksum(self):
        
        checksum = self.__get_checksum(self.__out_buffer.raw)
        self.STRUCT_CHECKSUM.pack_into(self.__out_buffer, self.OFFSET_CHECKSUM, checksum)
740047
public static function Serialize($Mixed) {
		if(is_array($Mixed) || is_object($Mixed)
			|| (is_string($Mixed) && (substr_compare('a:', $Mixed, 0, 2) === 0 || substr_compare('O:', $Mixed, 0, 2) === 0
				|| substr_compare('arr:', $Mixed, 0, 4) === 0 || substr_compare('obj:', $Mixed, 0, 4) === 0))) {
			$Result = serialize($Mixed);
		} else {
			$Result = $Mixed;
		}
		return $Result;
   }
979709
public function unserialize($serialized)
    {
        $entries = explode(':', $serialized, 2);
        $this->bin = null;
        $this->key = null;
        if (count($entries) === 2) {
            list($bin_length, $bin_and_key) = $entries;
            $bin_length = intval($bin_length);
            $this->bin = substr($bin_and_key, 0, $bin_length);
            $this->key = substr($bin_and_key, $bin_length + 1);
        }

        // @TODO: Remove check against false for PHP 7+
        if (false === $this->key || '' === $this->key) {
            $this->key = null;
        }
    }
576460
protected function calculateChecksum() {
        // Checksum
        // First CheckSUM "C"
        // The "C" checksum character is the modulo 47 remainder of the sum of the weighted
        // value of the data characters. The weighting value starts at "1" for the right-most
        // data character, 2 for the second to last, 3 for the third-to-last, and so on up to 20.
        // After 20, the sequence wraps around back to 1.

        // Second CheckSUM "K"
        // Same as CheckSUM "C" but we count the CheckSum "C" at the end
        // After 15, the sequence wraps around back to 1.
        $sequence_multiplier = array(20, 15);
        $this->checksumValue = array();
        $indcheck = $this->indcheck;
        for ($z = 0; $z < 2; $z++) {
            $checksum = 0;
            for ($i = count($indcheck), $j = 0; $i > 0; $i--, $j++) {
                $multiplier = $i % $sequence_multiplier[$z];
                if ($multiplier === 0) {
                    $multiplier = $sequence_multiplier[$z];
                }

                $checksum += $indcheck[$j] * $multiplier;
            }

            $this->checksumValue[$z] = $checksum % 47;
            $indcheck[] = $this->checksumValue[$z];
        }
    }