|
- Notes
- HashString and UNICODE
- Availability of algorithms
HashString (Function) In french: HashChaîne Versions 25 and later New in version 25 Syntax
Calculating a simple hash Hide the details
<Result> = HashString(<Type of algorithm> , <String>)
<Result>: Buffer Result of <String> hashing with the <Type of algorithm> algorithm.Caution: this result may contain non-displayable characters. If this result must be displayed, it can be converted by BufferToHexa. <Type of algorithm>: Integer constant Indicates the type of algorithm used when hashing the <String>:
- MD4 / MD5 / SHA / RIPEMD algorithms: standard cryptographic hash functions.
- TIGER/WHIRLPOOL algorithms: hash functions with high cryptographic properties optimized for the 64-bit mode (but can also be used in 32-bit mode).
- CKSUM algorithms: hash functions with no cryptographic property, should be used to perform low-level checks or with hashing tables.
Versions 22 and laterDJB2 algorithm (Bernstein): hash functions reserved to strings and with no cryptographic property, should be used to perform low-level checks or with hashing tables. Few risks to get an identical hash. New in version 22DJB2 algorithm (Bernstein): hash functions reserved to strings and with no cryptographic property, should be used to perform low-level checks or with hashing tables. Few risks to get an identical hash. DJB2 algorithm (Bernstein): hash functions reserved to strings and with no cryptographic property, should be used to perform low-level checks or with hashing tables. Few risks to get an identical hash. Versions 24 and laterMURMUR algorithm: very fast hash functions with no cryptographic properties. This algorithm is used by the "bloom filter" of bitcoin wallets. New in version 24MURMUR algorithm: very fast hash functions with no cryptographic properties. This algorithm is used by the "bloom filter" of bitcoin wallets. MURMUR algorithm: very fast hash functions with no cryptographic properties. This algorithm is used by the "bloom filter" of bitcoin wallets.
<String>: Character string (with quotes) String on which the calculation will be performed. This parameter can contain binary characters.
Calculating a hash with message authentication (HMAC/MURMUR algorithm) Hide the details
<Result> = HashString(<Type of algorithm> , <String> , <Secret key>)
<Result>: Buffer Result of <String> hashing with the <Type of algorithm> algorithm. The length of this string depends on the algorithm used. For example, if the HA_HMAC_SHA_256 constant is used, the result will contain 32 bytes.Caution: this result may contain non-displayable characters. <Type of algorithm>: Integer constant Indicates the type of algorithm (HMAC or MURMUR) used to hash the <String> string:
- MD4 / MD5 / SHA / RIPEMD algorithms: standard cryptographic hash functions.
- TIGER/WHIRLPOOL algorithms: hash functions with high cryptographic properties optimized for the 64-bit mode (but can also be used in 32-bit mode).
MURMUR algorithm: very fast hash functions with no cryptographic properties. This algorithm is used by the "bloom filter" of bitcoin wallets.
<String>: Character string (with quotes) String on which the calculation will be performed. This parameter can contain binary characters. <Secret key>: Character string (between quotes) or Integer Authentication key of message. - If an HMAC algorithm is used, this parameter must be a string.
Versions 24 and laterIf a MURMUR algorithm is used, the key must be an integer. New in version 24If a MURMUR algorithm is used, the key must be an integer. If a MURMUR algorithm is used, the key must be an integer.
Versions 25 and later New in version 25 Versions 25 and later New in version 25Remarks Notes - Two identical character strings will have, for the same type of algorithm, two identical Hashes.
- The result of the Hash may contain non-displayable characters. These characters will not be visible when using Info or Trace for example.
HashString and UNICODE - Caution: The Hash functions operate on the bytes found in the character strings. For the same type of algorithm, the result will differ in UNICODE and in ANSI.
- Multi-platform development: To use Hash of strings between several platforms (a hash generated in iOS and checked in Android or Windows for example), no Unicode string must be used. Indeed, the Unicode strings do not have the same format according to the platforms. In this case, we advise you to use strings in ANSI or UTF 8 format (and to convert the Unicode strings if necessary).
Related Examples:
|
Unit examples (WINDEV): The Hash functions
[ + ] Using the hashing functions. The HashFile and HashString functions are used to calculate a Hash key for a string or for a file. This Hash key is used to: - Check whether the file is consistent after a transfer for example - Find file duplicates - ...
|
Business / UI classification : Business Logic
This page is also available for…
|
|
|
| |
| | //Gera senha com criptografia dupla fazendo com SHA e depois aplicando a criptografia EncodeBase64
minha is string = "1234" rhash is string = HashString(HA_SHA_160,minha) res is string = Crypt(rhash,"",cryptNone,encodeBASE64) //RESULTADO: cRDtpNCeBiql5KOQsKVyrA0sAiA=
//Blog com informacoes sobre criptografia http://windevdesenvolvimento.blogspot.com.br/2016/01/wx-exemplo-da-criptografia-da-senha.html |
|
|
|
| |
| |
| |
| |
| |
| |
| | |
| |