PC SOFT

AYUDA EN LÍNEA
DE WINDEV, WEBDEV Y WINDEV MOBILE

  • Notes
  • HashString function and UNICODE
  • Availability of algorithms
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Otros
Procedimientos almacenados
HashString (Function)
 
Calculates the Hash of a character string according to a specific algorithm. You have the ability to calculate:
  • a simple hash.
  • a hash with message authentication.
Reminder: The hashing is used to summarize a file or a character string. This summary is called Hash.
Versiones 15 y posteriores
PHP This function is now available for the PHP sites.
Java This function is now available for the Java applications.
Android This function is now available for Android applications.
Nueva funcionalidad versión 15
PHP This function is now available for the PHP sites.
Java This function is now available for the Java applications.
Android This function is now available for Android applications.
PHP This function is now available for the PHP sites.
Java This function is now available for the Java applications.
Android This function is now available for Android applications.
Versiones 17 y posteriores
iPhone/iPad This function is now available for iPhone/iPad applications.
Nueva funcionalidad versión 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versiones 18 y posteriores
Universal Windows 10 App This function is now available in Windows Store apps mode.
Widget Android This function is now available in Android Widget mode.
Nueva funcionalidad versión 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Widget Android This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Widget Android This function is now available in Android Widget mode.
Versiones 21 y posteriores
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Nueva funcionalidad versión 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Ejemplo
// Calculate the Hash of values for two edit controls
Hash1 is Buffer = HashString(HA_MD5_128, EDT_Edit1)
Hash2 is Buffer = HashString(HA_MD5_128, EDT_Edit2)
// Compare the two Hash
IF Hash1 = Hash2 THEN Info("The two strings are identical.")
Sintaxis

Calculating a simple hash Ocultar los detalles

<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>:
Versiones 22 y posteriores
DJB2 family (Bernstein)
Nueva funcionalidad versión 22
DJB2 family (Bernstein)
DJB2 family (Bernstein)
Versiones 22 y posteriores
HA_DJB2_32
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 22
HA_DJB2_32
AndroidWidget Android JavaPHP Not available.
HA_DJB2_32
AndroidWidget Android JavaPHP Not available.
Versiones 22 y posteriores
HA_DJB2_64
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 22
HA_DJB2_64
AndroidWidget Android JavaPHP Not available.
HA_DJB2_64
AndroidWidget Android JavaPHP Not available.
MD5 familyHA_MD5_128
Versiones 24 y posteriores
MURMUR family
(Multiply Rotate)
Nueva funcionalidad versión 24
MURMUR family
(Multiply Rotate)
MURMUR family
(Multiply Rotate)
Versiones 24 y posteriores
HA_MURMUR_1: Murmur algorithm version 1: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_1: Murmur algorithm version 1: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_1: Murmur algorithm version 1: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_2: Murmur algorithm version 2: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_2: Murmur algorithm version 2: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_2: Murmur algorithm version 2: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_2_64A: Murmur algorithm version 2: 64-bit hash result optimized for 64-bit processors
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_2_64A: Murmur algorithm version 2: 64-bit hash result optimized for 64-bit processors
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_2_64A: Murmur algorithm version 2: 64-bit hash result optimized for 64-bit processors
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_2_64B: Murmur algorithm version 2: 64-bit hash result optimized for 32-bit processors
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_2_64B: Murmur algorithm version 2: 64-bit hash result optimized for 32-bit processors
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_2_64B: Murmur algorithm version 2: 64-bit hash result optimized for 32-bit processors
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_2_A: Incremental Murmur algorithm version 2: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_2_A: Incremental Murmur algorithm version 2: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_2_A: Incremental Murmur algorithm version 2: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_2_BIG_ENDIAN: Murmur algorithm version 2 for big-endian machine: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_2_BIG_ENDIAN: Murmur algorithm version 2 for big-endian machine: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_2_BIG_ENDIAN: Murmur algorithm version 2 for big-endian machine: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_2_ALIGNED: Murmur algorithm version 2 for aligned machine: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_2_ALIGNED: Murmur algorithm version 2 for aligned machine: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_2_ALIGNED: Murmur algorithm version 2 for aligned machine: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_3_32: Murmur algorithm version 3: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_3_32: Murmur algorithm version 3: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_3_32: Murmur algorithm version 3: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_3_128_X86: Murmur algorithm version 3: 128-bit hash result optimized for 32-bit processors
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_3_128_X86: Murmur algorithm version 3: 128-bit hash result optimized for 32-bit processors
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_3_128_X86: Murmur algorithm version 3: 128-bit hash result optimized for 32-bit processors
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_3_128_X64: Murmur algorithm version 3: 128-bit hash result optimized for 64-bit processors
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_3_128_X64: Murmur algorithm version 3: 128-bit hash result optimized for 64-bit processors
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_3_128_X64: Murmur algorithm version 3: 128-bit hash result optimized for 64-bit processors
AndroidWidget Android JavaPHP Not available.
SHA-1 familyHA_SHA_160 (also called SHA-1)
HA_SHA_256 (FIPS PUB 198 specifications)
HA_SHA_384
HA_SHA_512
Versiones 23 y posteriores
SHA-3 family
Nueva funcionalidad versión 23
SHA-3 family
SHA-3 family
Versiones 23 y posteriores
HA_SHA3_224
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 23
HA_SHA3_224
AndroidWidget Android JavaPHP Not available.
HA_SHA3_224
AndroidWidget Android JavaPHP Not available.
Versiones 23 y posteriores
HA_SHA3_256
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 23
HA_SHA3_256
AndroidWidget Android JavaPHP Not available.
HA_SHA3_256
AndroidWidget Android JavaPHP Not available.
Versiones 23 y posteriores
HA_SHA3_384
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 23
HA_SHA3_384
AndroidWidget Android JavaPHP Not available.
HA_SHA3_384
AndroidWidget Android JavaPHP Not available.
Versiones 23 y posteriores
HA_SHA3_512
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 23
HA_SHA3_512
AndroidWidget Android JavaPHP Not available.
HA_SHA3_512
AndroidWidget Android JavaPHP Not available.
RIPEMD familyHA_RIPEMD_128
AndroidWidget Android Java Not available.
HA_RIPEMD_160
AndroidWidget Android Java Not available.
TIGER familyHA_TIGER_128
AndroidWidget Android JavaPHP Not available.
AndroidWidget Android Java Not available.
HA_TIGER_160
AndroidWidget Android JavaPHP Not available.
AndroidWidget Android Java Not available.
HA_TIGER_192
AndroidWidget Android JavaPHP Not available.
AndroidWidget Android Java Not available.
WHIRLPOOL familyHA_WHIRLPOOL
AndroidWidget Android Java Not available.
CKSUM familyHA_CKSUM_8
AndroidWidget Android Java Not available.
HA_CKSUM_16
AndroidWidget Android Java Not available.
HA_CKSUM_32
AndroidWidget Android Java Not available.
HA_CKSUM_64
AndroidWidget Android Java Not available.
  • 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).
    PHP The TIGER algorithms are not available.
  • CKSUM algorithms: hash functions with no cryptographic property, should be used to perform low-level checks or with hashing tables.
  • Versiones 22 y posteriores
    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.
    Nueva funcionalidad versión 22
    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.
    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.
  • Versiones 24 y posteriores
    MURMUR algorithm (Multiply Rotate): very fast hashing functions. This algorithm is used by the "bloom filter" of bitcoin wallets.
    Nueva funcionalidad versión 24
    MURMUR algorithm (Multiply Rotate): very fast hashing functions. This algorithm is used by the "bloom filter" of bitcoin wallets.
    MURMUR algorithm (Multiply Rotate): very fast hashing functions. 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) Ocultar los detalles

<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:
MD5 familyHA_HMAC_MD5_128
Versiones 24 y posteriores
MURMUR family
(Multiply Rotate)
Nueva funcionalidad versión 24
MURMUR family
(Multiply Rotate)
MURMUR family
(Multiply Rotate)
Versiones 24 y posteriores
HA_MURMUR_1: Murmur algorithm version 1: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_1: Murmur algorithm version 1: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_1: Murmur algorithm version 1: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_2: Murmur algorithm version 2: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_2: Murmur algorithm version 2: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_2: Murmur algorithm version 2: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_2_64A: Murmur algorithm version 2: 64-bit hash result optimized for 64-bit processors
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_2_64A: Murmur algorithm version 2: 64-bit hash result optimized for 64-bit processors
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_2_64A: Murmur algorithm version 2: 64-bit hash result optimized for 64-bit processors
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_2_64B: Murmur algorithm version 2: 64-bit hash result optimized for 32-bit processors
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_2_64B: Murmur algorithm version 2: 64-bit hash result optimized for 32-bit processors
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_2_64B: Murmur algorithm version 2: 64-bit hash result optimized for 32-bit processors
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_2_A: Incremental Murmur algorithm version 2: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_2_A: Incremental Murmur algorithm version 2: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_2_A: Incremental Murmur algorithm version 2: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_2_BIG_ENDIAN: Murmur algorithm version 2 for big-endian machine: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_2_BIG_ENDIAN: Murmur algorithm version 2 for big-endian machine: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_2_BIG_ENDIAN: Murmur algorithm version 2 for big-endian machine: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_2_ALIGNED: Murmur algorithm version 2 for aligned machine: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_2_ALIGNED: Murmur algorithm version 2 for aligned machine: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_2_ALIGNED: Murmur algorithm version 2 for aligned machine: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_3_32: Murmur algorithm version 3: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_3_32: Murmur algorithm version 3: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_3_32: Murmur algorithm version 3: 32-bit result hash
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_3_128_X86: Murmur algorithm version 3: 128-bit hash result optimized for 32-bit processors
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_3_128_X86: Murmur algorithm version 3: 128-bit hash result optimized for 32-bit processors
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_3_128_X86: Murmur algorithm version 3: 128-bit hash result optimized for 32-bit processors
AndroidWidget Android JavaPHP Not available.
Versiones 24 y posteriores
HA_MURMUR_3_128_X64: Murmur algorithm version 3: 128-bit hash result optimized for 64-bit processors
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 24
HA_MURMUR_3_128_X64: Murmur algorithm version 3: 128-bit hash result optimized for 64-bit processors
AndroidWidget Android JavaPHP Not available.
HA_MURMUR_3_128_X64: Murmur algorithm version 3: 128-bit hash result optimized for 64-bit processors
AndroidWidget Android JavaPHP Not available.
SHA familyHA_HMAC_SHA_160
HA_HMAC_SHA_256
HA_HMAC_SHA_384
HA_HMAC_SHA_512
Versiones 23 y posteriores
SHA-3 family
Nueva funcionalidad versión 23
SHA-3 family
SHA-3 family
Versiones 23 y posteriores
HA_SHA3_224
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 23
HA_SHA3_224
AndroidWidget Android JavaPHP Not available.
HA_SHA3_224
AndroidWidget Android JavaPHP Not available.
Versiones 23 y posteriores
HA_SHA3_256
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 23
HA_SHA3_256
AndroidWidget Android JavaPHP Not available.
HA_SHA3_256
AndroidWidget Android JavaPHP Not available.
Versiones 23 y posteriores
HA_SHA3_384
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 23
HA_SHA3_384
AndroidWidget Android JavaPHP Not available.
HA_SHA3_384
AndroidWidget Android JavaPHP Not available.
Versiones 23 y posteriores
HA_SHA3_512
AndroidWidget Android JavaPHP Not available.
Nueva funcionalidad versión 23
HA_SHA3_512
AndroidWidget Android JavaPHP Not available.
HA_SHA3_512
AndroidWidget Android JavaPHP Not available.
RIPEMD familyHA_HMAC_RIPEMD_128
AndroidWidget Android Java Not available.
HA_HMAC_RIPEMD_160
AndroidWidget Android Java Not available.
TIGER familyHA_HMAC_TIGER_128
AndroidWidget Android JavaPHP Not available.
AndroidWidget Android Java Not available.
HA_HMAC_TIGER_160
AndroidWidget Android JavaPHP Not available.
AndroidWidget Android Java Not available.
HA_HMAC_TIGER_192
AndroidWidget Android JavaPHP Not available.
AndroidWidget Android Java Not available.
WHIRLPOOL familyHA_HMAC_WHIRLPOOL
AndroidWidget Android Java Not available.
  • 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).
    PHP The TIGER algorithms are not available.
  • Versiones 24 y posteriores
    MURMUR algorithm (Multiply Rotate): very fast hashing functions. This algorithm is used by the "bloom filter" of bitcoin wallets.
    Nueva funcionalidad versión 24
    MURMUR algorithm (Multiply Rotate): very fast hashing functions. This algorithm is used by the "bloom filter" of bitcoin wallets.
    MURMUR algorithm (Multiply Rotate): very fast hashing functions. 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.
  • Versiones 24 y posteriores
    If a MURMUR algorithm is used, the key must be an integer.
    Nueva funcionalidad versión 24
    If a MURMUR algorithm is used, the key must be an integer.
    If a MURMUR algorithm is used, the key must be an integer.
AndroidWidget Android Java This parameter must not be an empty string.
Observaciones

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 function 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).

Availability of algorithms

PHP
  • The available algorithms depend on the configuration of PHP server.
  • The TIGER algorithms are not available.The SHA-3 algorithms are not available.
AndroidWidget Android Java Only the following algorithms are supported :
  • HA_MD5_128
  • HA_SHA_160, HA_SHA_256, HA_SHA_384, HA_SHA_512
  • HA_HMAC_MD5_128
  • HA_HMAC_SHA_160, HA_HMAC_SHA_256, HA_HMAC_SHA_384, HA_SHA_HMAC_512.
Componente : wd240com.dll
Versión mínima requerida
  • Versión 11
Esta página también está disponible para…
Comentarios
Exemplo HashString
//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
De matos AMARILDO
28 01 2016