Etag

Etag zur Überprüfung des Datenstroms auf Änderung, theoretisch ist hier jede Prüfsumme möglich, bei mir kommt crc32 zum Einsatz, zuvor hatte ich md5 genutzt jedoch ist crc32 wesentlich schneller außerdem braucht man den Wert sowieso für den GZIP-Header.

Etag Generierung aus CRC32 und Size:

function EtagCRC32(const buf: PChar; const len: cardinal): RawByteString;
var crc: longword;
begin
  crc := crc32(0, buf, len);
  result := IntToHex(crc, 8) + IntToHex(len, 8);
end;

Etag Generierung aus MD5:

function EtagMD5(const buf: PChar; const len: cardinal): RawByteString;
begin
  result := MD5Print(MD5Buffer(buf, len))
end;

 Der Etag muss im Header in Anführungszeichen stehen.

'Etag: "' + Etag + '"'#13#10

Kontakt

Udo Schmal
Udo Schmal

Udo Schmal
Softwareentwickler
Ellerndiek 26
24837 Schleswig
Schleswig-Holstein
Germany




+49 4621 9785538
+49 1575 0663676
+49 4621 9785539
SMS
WhatsApp

Google Maps Profile
Instagram Profile
vCard 2.1, vCard 3.0, vCard 4.0

Service Infos

CMS Info

Product Name:
UDOs Webserver
Version:
0.5.1.68
Description:
All in one Webserver
Copyright:
Udo Schmal
Compilation:
Sat, 9. Mar 2024 07:54:53

Development Info

Compiler:
Free Pascal FPC 3.3.1
compiled for:
OS:Linux, CPU:x86_64

System Info

OS:
Ubuntu 22.04.4 LTS (Jammy Jellyfish)

Hardware Info

Model:
Hewlett-Packard HP Pavilion dm4 Notebook PC
CPU Name:
Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz
CPU Type:
x86_64, 1 physical CPU(s), 2 Core(s), 4 logical CPU(s),  MHz