ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Hash functions
  • Converting a hash in binary format into the hexadecimal format
  • Converting a hash in hexadecimal format into the binary format
HashString (Example)
Converting a hash in binary format into the hexadecimal format
sHash_Binary is string = HashString(HA_SHA_160, "String", "Key")
sHash_Hexa is string
FOR nIndex = 1 _TO_ Length(sHash_Binary)
sHash_Hexa += NumToString(Asc(sHash_Binary[[nSubscript]]),"02x")
END
Trace(sHash_Hexa)
Converting a hash in hexadecimal format into the binary format
sHash_Hexa is string = "918d40029ce4fc9702a62fdee8977b66b38b9ccf"
sHash_Binary is string
FOR nSub = 1  _TO_ Length(sHash_Hexa) STEP 2
sHash_Binary_ += Charact(Val(sHash_Hexa[[nSub ON 2]], "x"))
END
IF HashCheckString(HA_SHA_160, "String", sHash_Binary, "Key") = True THEN
Info("Hash OK")
END
Minimum version required
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help