Autor Beitrag
Crishnu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Mi 20.04.05 20:19 
Ich möchte einen ganz normalen string in urlencode darstellen.
Ich hab die Boardsuche schon benutzt, doch die Beispiele haben nicht den
gewünschten Effekt.

Aus:
197b5fe39cae9c2f3643ecc180a43349ee1ed610

Soll zb:
%19%7B%5F%E3%9C%AE%9C%2F6C%EC%C1%80%A43I%EE%1E%D6%10

das werden.

Kann mir da jemand helfen???

MFG
Martin77
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 282

XP Prof
D6 Prof, D7 Personal, D7 Enterprise, D8 personal
BeitragVerfasst: Mi 20.04.05 21:36 
Hmmm

dassieht aber nicht wie URL Encode aus, daherdürften dir die anderen Beispiel auch nichts bringen

So wie es ausschaut, musst Du für dein VErfahren nur alle 2 Zeichen das % Zeichen einfügen, Copy und length dürfte dir weiterhelfen.

MArtin
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mi 20.04.05 21:57 
Hallo,

:wave: willkommen :wave:

Das zur Information über URLEncode:URLEncode Code Chart
URLEncode = Prozentzeichen, gefolgt vom Hexadezimal-Code des Ascii-Codes.

Um deine String wie in deinem Beispiel umzusetzen, kannst Du das von Martin77 Vorgeschlagene verwenden und zusätzlich noch mit UpperCase die Zeichen in Großbuchstaben konvertieren.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Martin77
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 282

XP Prof
D6 Prof, D7 Personal, D7 Enterprise, D8 personal
BeitragVerfasst: Do 21.04.05 05:36 
user profile iconLannes hat folgendes geschrieben:
....noch mit UpperCase die Zeichen in Großbuchstaben konvertieren.



Jetzt wo Du es sagst, stimmt die sind alle Groß.

Je nachdem was bei dir für Daten kommen solltest Du besser AnsiUpperCase verwenden, in Bezug auf Umlaute.

Martin
Crishnu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Do 21.04.05 07:04 
oben im STring gibts aber auc 2 Stellen wo das mit dem % einsetzten nicht funktioniert,
was soll ich da machen?
Martin77
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 282

XP Prof
D6 Prof, D7 Personal, D7 Enterprise, D8 personal
BeitragVerfasst: Do 21.04.05 12:29 
wo denn?
Crishnu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Do 21.04.05 15:19 
ZB bei %2F6C und %A43I
Martin77
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 282

XP Prof
D6 Prof, D7 Personal, D7 Enterprise, D8 personal
BeitragVerfasst: Do 21.04.05 18:47 
Woher stammt das Beispiel denn? ist das denn so richtig?
Crishnu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Fr 22.04.05 21:16 
Auf der Seite: www.bittorrent.com/protocol.html
steht mehr dazu. Es handelt sich um einen info-hash.

Crishnu
Martin77
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 282

XP Prof
D6 Prof, D7 Personal, D7 Enterprise, D8 personal
BeitragVerfasst: Sa 23.04.05 07:40 
Zitat:
pieces maps to a string whose length is a multiple of 20. It is to be subdivided into strings of length 20, each of which is the SHA1 hash of the piece at the corresponding index.


Also SHA1, dazu dürfteste bei google oder über die Forensuche genug finden
ByStones
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 92
Erhaltene Danke: 1

Windows XP
Delphi 2005
BeitragVerfasst: So 24.04.05 09:48 
In PHP geht es so:
ausblenden Delphi-Quelltext
1:
urlencode ("Hier ist der Text...");					
Martin77
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 282

XP Prof
D6 Prof, D7 Personal, D7 Enterprise, D8 personal
BeitragVerfasst: So 24.04.05 14:48 
Hast Du den Thread überhaupt gelesen?
user profile iconByStones hat folgendes geschrieben:
In PHP geht es so:
ausblenden Delphi-Quelltext
1:
urlencode ("Hier ist der Text...");					


Das was er sucht ist garkein URL Encode!!!


Martin
Crishnu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Mi 27.04.05 21:24 
Ok, hab mich mal etwas informiert.
Es reicht aus vor jedem 2. ein % zu machen.
Weiß jemand mit welchem Verfahren das geht???

MFG
Martin77
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 282

XP Prof
D6 Prof, D7 Personal, D7 Enterprise, D8 personal
BeitragVerfasst: Mi 27.04.05 22:16 
Hast Du mal nach dem Algo gesucht den Ich dir weiter oben genannt habe, der auch auf der von dir angegebenen Seite abgesprochen wurde?
Crishnu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Do 28.04.05 16:21 
Ja, ich hab was gesucht, aber das brauch ich ja jetzt nicht mehr :D
Ich müsste nur wissen, wie ich hinter jedem 2. zeichen ein % machen kann.
Martin77
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 282

XP Prof
D6 Prof, D7 Personal, D7 Enterprise, D8 personal
BeitragVerfasst: Do 28.04.05 17:31 
Wie wäre es mit Copy??

Die Onlinehilfe hilft dir da sicherlich weiter ,soltlest aber auch hier im Forum genügend Hilfe zu Copy finden
Radioactive
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179

Win 98, Win XP Home SP2
D3 Prof, D7 Pers, D2005 Pers
BeitragVerfasst: Do 28.04.05 17:48 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
function falschesURLEncode(str: String): String;
var 
  i, j: Integer;
  Ergebnis: String;
begin
  j := -1;
  for i := 1 to (Length(str) div 2) do
  begin
    j := j + 2;
    Ergebnis := '%' + copy(str, j, 2);
  end;
  Result := Ergebnis;
end;

_________________
Radioactive
"Wer scrollt, verliert!" Matthias Stein, Informatiklehrer am GG