FOROS PROFESIONALES
WINDEV
,
WEBDEV
y
WINDEV Mobile
Inicio
|
Mensajes recientes
|
Conéctese...
|
Desconectar
|
Español
Inicio
→
WINDEV 2024
→
How to handle multi-line string in HashString ?
How to handle multi-line string in HashString ?
Iniciado por Mick, 26,ene. 2021 06:03 - 1 respuesta
Conéctese…
Mick
#1
Publicado el 26,enero 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
Informar
0
0
Argus
#2
Publicado el 26,enero 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
Informar
0
0
→ Volver a WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versiones precedentes)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Búsqueda Tipo
Sólo temas
Todos los mensajes
Periodo Buscar
Cualquier fecha
Última hora
Última 24 horas
Última semana
Último mes
Último año
Cancelar
Vista previa del mensaje
Añadiendo una imagen
Importar una imagen desde una URL
Enviar una imagen desde un archivo de su disco
Arrastrar un archivo o click en "Examinar..."
o
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto