Gets an MD5 hash code of the internal date. Return result can be raw binary or hex by default

@param  bool|null $raw_output return the raw binary bytes or hex values of the md5 hash
@return string
501100
public function md5($format = null, $raw_output = false)
	{
		return hash('md5', parent::format($format === null ? static::$format : $format), $raw_output);
	}
497110
def hash_for_datasource(data_source):
        
        import hashlib
        hash_value = hashlib.md5()
        hash_value.update(data_source.encode('utf-8'))
        hash_value = hash_value.hexdigest()
        return hash_value
396433
function deserialize (rawData) {
  return JSON.parse(rawData, function (k, v) {
    if (k === '$$date') { return new Date(v); }
    if (typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean' || v === null) { return v; }
    if (v && v.$$date) { return v.$$date; }
    if (v && v.$$regex) { return deserializeRegex(v.$$regex) }

    return v;
  });
}
960264
function raw($arg) {
		return $this->fw->recursive($arg,
			function($val) {
				return is_string($val)?$this->fw->decode($val):$val;
			}
		);
	}
301416
public static function md5()
    {
        // Helper Class Exists
        if (isset(self::$ChecksumHelper)) {
            return self::$ChecksumHelper;
        }
        // Initialize Class
        self::$ChecksumHelper = new ChecksumHelper();
        // Return Helper Class
        return self::$ChecksumHelper;
    }
1069441
public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
	{
		if (is_string($algoOrCtx)) {
			$ctx = hash_init($algoOrCtx);
		} else {
			$ctx = $algoOrCtx;
		}

		if (isset($object->name)) {
			hash_update($ctx, 'name');
			hash_update($ctx, (string)$object->name);
		}

		if (isset($object->value)) {
			hash_update($ctx, 'value');
			foreach ($object->value instanceof \Traversable ? $object->value : (array)$object->value as $v0) {
				EnumValueDescriptorProtoMeta::hash($v0, $ctx);
			}
		}

		if (isset($object->options)) {
			hash_update($ctx, 'options');
			EnumOptionsMeta::hash($object->options, $ctx);
		}

		if (is_string($algoOrCtx)) {
			return hash_final($ctx, $raw);
		} else {
			return null;
		}
	}
1169118
def to_rawtx(tx):
    
    if tx.get('hex'):
        return tx['hex']

    new_tx = {}

    locktime = tx.get('locktime', 0)
    new_tx['locktime'] = locktime
    new_tx['version'] = tx.get('version', 1)
    new_tx['ins'] = [
        {
            'outpoint': {'hash': str(x['txid']), 'index': x['n']},
            'script': str(x['scriptSig'].replace(' ', '')),
            'sequence': x.get('sequence', 0xFFFFFFFF if locktime == 0 else None)
        } for x in tx['inputs']
    ]

    new_tx['outs'] = [
        {
            'script': str(x['scriptPubKey']),
            'value': x['amount']
        } for x in tx['outputs']
    ]

    return serialize(new_tx)
770368
function _hash($data, $controlType)
    {
        switch ($controlType) {
        case 'md5':
            return md5($data);
        case 'crc32':
            return sprintf('% 32d', crc32($data));
        case 'strlen':
            return sprintf('% 32d', strlen($data));
        default:
            return $this->raiseError('Unknown controlType ! (available values are only \'md5\', \'crc32\', \'strlen\')', -5);
        }
    }
1281485
public function sha256($format = null, $raw_output = false)
	{
		return hash('sha256', parent::format($format === null ? static::$format : $format), $raw_output);
	}
1110119
function get_local_md5() {
        global $CFG;

    /// Check requisites are passed
        if (!$this->requisitesok) {
            return false;
        }

        $return_value = 'needtobeinstalled';   /// Fake value to force new installation

    /// Calculate source to read
       $source = $CFG->dataroot.'/'.$this->destpath.'/'.$this->componentname.'/'.$this->componentname.'.md5';
    /// Read md5 value stored (if exists)
       if (file_exists($source)) {
           if ($temp = file_get_contents($source)) {
               $return_value = $temp;
           }
        }
        return $return_value;
    }
971525
public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
	{
		if (is_string($algoOrCtx)) {
			$ctx = hash_init($algoOrCtx);
		} else {
			$ctx = $algoOrCtx;
		}

		if (isset($object->location)) {
			hash_update($ctx, 'location');
			foreach ($object->location instanceof \Traversable ? $object->location : (array)$object->location as $v0) {
				LocationMeta::hash($v0, $ctx);
			}
		}

		if (is_string($algoOrCtx)) {
			return hash_final($ctx, $raw);
		} else {
			return null;
		}
	}
593971
private function decode($data, $raw)
    {
        if (is_array($data)) {
            foreach ($data as $k => &$v) {
                $v = $this->decode($v, $raw[$k]);
            }
            return $data;
        }

        $data = $this->decodeBoolean($data, $raw);
        $data = $this->decodeNull($data, $raw);

        if (is_numeric($data) && ((string)($data + 0) === $data))
            return $data + 0;

        if (is_string($raw) && empty($raw))
            return "";

        return $data;
    }
744022
protected function raw(Raw $raw): string
	{
		$parameters = $raw->getParameters();

		if(!empty($parameters))
		{
			$this->params = array_merge($this->params, $parameters);
		}

		return $raw->getSql();
	}
812664
def dump(self, raw=False):
        '''  '''
        raw_out = self.ser.read(self.ser.in_waiting)
        if raw:
            return raw_out
        return raw_out.decode(OUTPUT_ENCODING)
449752
public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
	{
		if (is_string($algoOrCtx)) {
			$ctx = hash_init($algoOrCtx);
		} else {
			$ctx = $algoOrCtx;
		}

		if (is_string($algoOrCtx)) {
			return hash_final($ctx, $raw);
		} else {
			return null;
		}
	}
772823
public static function random_bytes($length, $raw = false)
    {
        $hextab  = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        $tabsize = strlen($hextab);

        // Use PHP7 true random generator
        if ($raw && function_exists('random_bytes')) {
            return random_bytes($length);
        }

        if (!$raw && function_exists('random_int')) {
            $result = '';
            while ($length-- > 0) {
                $result .= $hextab[random_int(0, $tabsize - 1)];
            }

            return $result;
        }

        $random = openssl_random_pseudo_bytes($length);

        if ($random === false && $length > 0) {
            throw new Exception("Failed to get random bytes");
        }

        if (!$raw) {
            for ($x = 0; $x < $length; $x++) {
                $random[$x] = $hextab[ord($random[$x]) % $tabsize];
            }
        }

        return $random;
    }
513693
public function getRoot(bool $raw = false): string
    {
        if (!$this->rootCalculated) {
            $this->root = $this->calculateRoot();
        }
        return $raw
            ? $this->root
            : Hex::encode($this->root);
    }