FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
How to handle multi-line string in HashString ?
How to handle multi-line string in HashString ?
Débuté par Mick, 26 jan. 2021 06:03 - 1 réponse
Connectez-vous…
Mick
#1
Posté le 26 janvier 2021 - 06:03
hi, i am mick. i have a rough problem in using HashString.
when the string is multi-line, the hash result is wrong.
i use code:
strHttpString
is string
= [
i am
]
strResult
is string
=
Lower
(
BufferToHexa
(
HashString
(
HA_SHA_160
,
StringToUTF8
(
strHttpString
)
)
,
NoGrouping
,
NoLine
)
)
Trace
(
strResult
)
or
strHttpString
is string
=
"i am"
+
CR
strResult
is string
=
Lower
(
BufferToHexa
(
HashString
(
HA_SHA_160
,
StringToUTF8
(
strHttpString
)
)
,
NoGrouping
,
NoLine
)
)
Trace
(
strResult
)
the windev result is "19af6844c098b8b31aed426ab72901cf034276d2"
But the right result should be "b4b1f1eda0ed819f19aee3b5f296887ee17019aa"
How to use newline characters in HashString?
Thanks
Signaler
0
0
Argus
#2
Posté le 26 janvier 2021 - 12:43
I think your problem is to say that the RIGHT result is this or that... Instead, tell us WHERE you are getting this DIFFERENT result...
In windows, the next line is defined by CR+LF, so the CR constant in wlanguage adds in fact TWO characters... If your RIGHT result is coming from a LINUX source (or equivalent), then it's probably using ONLY LF, and that would account for your DIFFERENCE.
The hashstring function is working fine ... it is just working with what YOU are giving it
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte