hash_copy

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

hash_copyDupliziert einen Hash-Kontext

Beschreibung

hash_copy(HashContext $context): HashContext

Parameter-Liste

context

Von hash_init() zurückgegebener Hash-Kontext.

Rückgabewerte

Gibt eine Kopie des Hash-Kontexts zurück.

Changelog

Version Beschreibung
7.2.0 Erwartet und liefert nun einen HashContext anstatt einer Ressource.

Beispiele

Beispiel #1 hash_copy()-Beispiel

<?php
$context 
hash_init("md5");
hash_update($context"data");

/* Dupliziere Kontext um ihn weiter nutzen zu können */
$copy_context hash_copy($context);

echo 
hash_final($context), "\n";

hash_update($copy_context"data");
echo 
hash_final($copy_context), "\n";
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

8d777f385d3dfec8815d20f7496026dc
511ae0b1c13f95e5f08f1a0dd3da3d93

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Bild drehen

Nice tips! It's great to see developers actively helping each other with real-world PHP challenges like this. If you're as curious as I am about s ...

Geschrieben von rahulhsol am 04.06.2025 11:11:21
Forum: PHP Developer Forum
Bild drehen

Glad I found this post. I’ve been searching for a reliable way to auto-rotate uploaded images correctly. If you're as curious as I am about solu ...

Geschrieben von rahulhsol am 04.06.2025 11:09:45
Forum: PHP Developer Forum
Bild drehen

Good discussion! I’ve used similar functions in my projects, but this thread gave me a fresh perspective. If you're as curious as I am about sol ...

Geschrieben von rahulhsol am 04.06.2025 11:04:01
Forum: PHP Developer Forum
Bild drehen

I appreciate the clear explanation. Rotating images with PHP gets confusing sometimes—this helps simplify it. If you're as curious as I am about ...

Geschrieben von rahulhsol am 04.06.2025 11:02:09
Forum: PHP Developer Forum