AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones Hash
  • Notes
  • Availability of algorithms
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Calculates the Hash of a file according to a specific algorithm. You have the ability to calculate:
  • a simple hash.
  • a hash with message authentication.
  • a hash obtained with a key derivation function that takes a salt as parameter (PBKDF2).
    AndroidWidget Android JavaPHP Not available.
Reminder Hashing is used to produce a condensed summary of a file or character string. This summary is called Hash.
Caution: Result may contain characters that cannot be displayed. If you want to get a string with the hexadecimal representations of bytes (to use it in a REST or SOAP API, for example) you can use BufferToHexa with the NoGrouping constant on the result buffer.
WINDEVWEBDEV - Código ServidorReportes y ConsultasCódigo de Usuario (UMC)Ajax
// Calculate the Hash of two files
Hash1 is Buffer = HashFile(HA_MD5_128, "C:\My files\FileA.txt")
Hash2 is Buffer = HashFile(HA_MD5_128, "D:\My files\FileB.txt")
// Compare the two Hash
IF Hash1 = Hash2 THEN Info("The two files are identical.")
Sintaxis

Calculating a simple hash Ocultar los detalles

<Result> = HashFile(<Type of algorithm> , <File path> [, <Progress Bar>])
<Result>: Buffer
Result of <File path> hashing with the <Type of algorithm> algorithm.
<Type of algorithm>: Integer constant
Indicates the type of algorithm used when hashing the <File path> file:
MD4 familyHA_MD4

MD5 familyHA_MD5_128
Please note: this type of algorithm is currently deprecated.
MURMUR family
  • HA_MURMUR_1 Murmur algorithm version 1: 32-bit hash result
  • HA_MURMUR_2 Murmur algorithm version 2: 32-bit hash result
  • HA_MURMUR_2_64A Murmur algorithm version 2: 64-bit hash result optimized for 64-bit processors
  • HA_MURMUR_2_64B Murmur algorithm version 2: 64-bit hash result optimized for 32-bit processors
  • HA_MURMUR_2_A Murmur version 2 incremental algorithm: 32-bit hash result
  • HA_MURMUR_2_BIG_ENDIAN Murmur algorithm version 2 for big-endian machine: 32-bit hash result
  • HA_MURMUR_2_ALIGNE Murmur algorithm version 2 for aligned machine: 32-bit hash result
  • HA_MURMUR_3_32 Murmur algorithm version 3: 32-bit hash result
  • HA_MURMUR_3_128_X86 Murmur algorithm version 3: 128-bit hash result optimized for 32-bit processors
  • HA_MURMUR_3_128_X64 Murmur algorithm version 3: 128-bit hash result optimized for 64-bit processors
Java The constants of this family are not available.
RIPEMD family
  • HA_RIPEMD_128
  • HA_RIPEMD_160
Java The constants of this family are not available.
SHA family
  • HA_SHA_160 (also called SHA-1)
  • HA_SHA_256 (FIPS PUB 198 specifications)
  • HA_SHA_256_DOUBLE
  • HA_SHA_384
  • HA_SHA_512
SHA-3 family
  • HA_SHA3_224
  • HA_SHA3_256
  • HA_SHA3_384
  • HA_SHA3_512
TIGER family
  • HA_TIGER_128
  • HA_TIGER_160
  • HA_TIGER_192
Java The constants of this family are not available.
WHIRLPOOL familyHA_WHIRLPOOL
Java Not available.
CKSUM family
  • HA_CKSUM_8
  • HA_CKSUM_16
  • HA_CKSUM_32
  • HA_CKSUM_64
Java The constants of this family are not available.
  • MD4 / MD5 / SHA / RIPEMD algorithms: classic cryptographic hash functions.
  • TIGER / WHIRLPOOL algorithms: hash functions with very good cryptographic properties, optimized for 64-bit (but can be used in 32-bit).
  • CKSUM algorithms: hash functions with no cryptographic properties, to be used only for minimal checks or hash tables.
  • MURMUR algorithm: very fast hash functions with no cryptographic properties. This algorithm is used by the "bloom filter" of bitcoin wallets.
<File path>: Character string
Path of file on which the calculation will be performed.
<Progress Bar>: Optional window name or optional control name
WINDEVWEBDEV - Código ServidoriPhone/iPadIOS WidgetMac Catalyst
  • Name of the window in which the progress bar will be displayed,
  • Name of the Progress Bar control to use.
WEBDEV - Código Servidor This parameter is ignored.

Calculating a hash with message authentication (HMAC/MURMUR algorithm) Ocultar los detalles

<Result> = HashFile(<Type of algorithm> , <File path> , <Secret key> [, <Progress Bar>])
<Result>: Buffer
Result of <File path> hashing with the <Type of algorithm> algorithm.
Warning: This result may contain characters that cannot be displayed.
<Type of algorithm>: Integer constant
Indicates the type of HMAC algorithm used when hashing the <File path> file:
MD4 familyHA_HMAC_MD4

MD5 familyHA_HMAC_MD5_128
Please note: this type of algorithm is currently deprecated.
MURMUR family
  • HA_MURMUR_1 Murmur algorithm version 1: 32-bit hash result
  • HA_MURMUR_2 Murmur algorithm version 2: 32-bit hash result
  • HA_MURMUR_2_64A Murmur algorithm version 2: 64-bit hash result optimized for 64-bit processors
  • HA_MURMUR_2_64B Murmur algorithm version 2: 64-bit hash result optimized for 32-bit processors
  • HA_MURMUR_2_A Murmur version 2 incremental algorithm: 32-bit hash result
  • HA_MURMUR_2_BIG_ENDIAN Murmur algorithm version 2 for big-endian machine: 32-bit hash result
  • HA_MURMUR_2_ALIGNE Murmur algorithm version 2 for aligned machine: 32-bit hash result
  • HA_MURMUR_3_32 Murmur algorithm version 3: 32-bit hash result
  • HA_MURMUR_3_128_X86 Murmur algorithm version 3: 128-bit hash result optimized for 32-bit processors
  • HA_MURMUR_3_128_X64 Murmur algorithm version 3: 128-bit hash result optimized for 64-bit processors
Java The constants of this family are not available.
RIPEMD family
  • HA_HMAC_RIPEMD_128
  • HA_HMAC_RIPEMD_160
Java The constants of this family are not available.
SHA family
  • HA_HMAC_SHA_160
  • HA_HMAC_SHA_256
  • HA_HMAC_SHA_256_DOUBLE
  • HA_HMAC_SHA_384
  • HA_HMAC_SHA_512
SHA-3 family
  • HA_HMAC_SHA3_224
  • HA_HMAC_SHA3_256
  • HA_HMAC_SHA3_384
  • HA_HMAC_SHA3_512
TIGER family
  • HA_HMAC_TIGER_128
  • HA_HMAC_TIGER_160
  • HA_HMAC_TIGER_192
Java The constants of this family are not available.
WHIRLPOOL familyHA_HMAC_WHIRLPOOL
Java Not available.
  • MD4 / MD5 / SHA / RIPEMD algorithms: classic cryptographic hash functions.
  • TIGER / WHIRLPOOL algorithms: hash functions with very good cryptographic properties, optimized for 64-bit (but can be used in 32-bit).
  • MURMUR algorithm: very fast hash functions with no cryptographic properties. This algorithm is used by the "bloom filter" of bitcoin wallets.
<File path>: Character string
Path of file on which the calculation will be performed.
<Secret key>: Character string or Secret string
Authentication key of message.
  • If an HMAC algorithm is used, this parameter must be a string.
  • If a MURMUR algorithm is used, the key must be an integer.
Novedad versión 2025
Cadenas secretas: Si utiliza el almacén de cadenas secretas, el tipo de cadena secreta utilizado para este parámetro puede ser:
  • Buffer - ASCII o Buffer - UTF-8,
  • ANSI string - Latin,
  • ANSI o Unicode string,
  • Unicode string.
Para obtener más información sobre las cadenas secretas y el almacén, consulte Almacén de cadenas secretas.
Novedad versión 2025
AndroidWidget Android Las cadenas secretas no están disponibles para este parámetro en aplicaciones Android y widgets de Android.
AndroidWidget Android Java This parameter must not be an empty string.
<Progress Bar>: Optional control name or optional window name
WINDEVWEBDEV - Código ServidoriPhone/iPadIOS WidgetMac Catalyst
  • Name of the window in which the progress bar will be displayed,
  • Name of the Progress Bar control to use.
WEBDEV - Código Servidor This parameter is ignored.
WindowsLinuxiPhone/iPadIOS WidgetMac Catalyst

Calculating a hash using a key derivation function that takes a salt as parameter (PBKDF2) Ocultar los detalles

<Result> = HashFile(<Type of algorithm> , <File path> , <Salt> , <Iteration> , <Length> [, <Progress Bar>])
<Result>: Buffer
Result of <File path> hashing with the <Type of algorithm> algorithm.
Warning: This result may contain characters that cannot be displayed.
<Type of algorithm>: Integer constant
Indicates the type of pseudo-random function used by PBKDF2 to hash the <File path> file:
MD4 familyHA_PBKDF2_HMAC_MD4
MD5 familyHA_PBKDF2_HMAC_MD5_128
Please note: this type of algorithm is currently deprecated.
RIPEMD family
  • HA_PBKDF2_HMAC_RIPEMD_128
  • HA_PBKDF2_HMAC_RIPEMD_160
SHA family
  • HA_PBKDF2_HMAC_SHA_160
  • HA_PBKDF2_HMAC_SHA_256
  • HA_PBKDF2_HMAC_SHA_256_DOUBLE
  • HA_PBKDF2_HMAC_SHA_384
  • HA_PBKDF2_HMAC_SHA_512
SHA-3 family
  • HA_PBKDF2_HMAC_SHA3_224
  • HA_PBKDF2_HMAC_SHA3_256
  • HA_PBKDF2_HMAC_SHA3_384
  • HA_PBKDF2_HMAC_SHA3_512
TIGER family
  • HA_PBKDF2_HMAC_TIGER_128
  • HA_PBKDF2_HMAC_TIGER_160
  • HA_PBKDF2_HMAC_TIGER_192
WHIRLPOOL familyHA_PBKDF2_HMAC_WHIRLPOOL
  • MD4 / MD5 / SHA / RIPEMD algorithms: classic cryptographic hash functions.
  • TIGER / WHIRLPOOL algorithms: hash functions with very good cryptographic properties, optimized for 64-bit (but can be used in 32-bit).
<File path>: Character string
Path of file on which the calculation will be performed.
<Salt>: Character string
Cryptographic salt used. String (usually random) added to the file to make it more complex.
<Iteration>: Integer
Number of iterations of the algorithm (10000 by default). This number depends on the power of the computing machine and the complexity of the hash. A minimum of 1000 iterations is generally recommended.
<Length>: Integer
Length of the derived key. By default, corresponds to the size of the key generated by the pseudo-random function. This length is technically unbounded but due to the algorithm, it is limited to (2^32 - 1) * (output length of the algorithm used by PBKDF2).
<Progress Bar>: Optional window name or optional control name
WINDEVWEBDEV - Código ServidoriPhone/iPadIOS WidgetMac Catalyst
  • Name of the window in which the progress bar will be displayed,
  • Name of the Progress Bar control to use.
WEBDEV - Código Servidor This parameter is ignored.
Observaciones

Notes

  • Two files with an identical content 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.
JavaPHP

Availability of algorithms

PHP Algorithms are available depending on the PHP server configuration ('mhash' extension, PHP 5 with native hash function, etc).
Java Only the following algorithms are supported:
  • HA_HMAC_MD5_128
  • HA_HMAC_SHA_160, HA_HMAC_SHA_256, HA_HMAC_SHA_384, HA_SHA_HMAC_512
  • HA_HMAC_SHA_256_DOUBLE
  • HA_MD4
  • HA_MD5_128
  • HA_SHA_160, HA_SHA_256, HA_SHA_384, HA_SHA_512
  • HA_SHA_256_DOUBLE
Clasificación Lógica de negocio / UI: Lógica de negocio
Componente: wd300com.dll
Versión mínima requerida
  • Versión 11
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 16/05/2025

Señalar un error o enviar una sugerencia | Ayuda local