hash

The hash library provides support for computing various hash functions. Currently supported are the following cryptographic hash functions:

md2

computes the MD2 hash function

md5

computes the MD5 hash function

sha

computes the SHA hash function

sha224

computes the SHA-224 hash function

sha256

computes the SHA-256 hash function

sha384

computes the SHA-384 hash function

sha512

computes the SHA-512 hash function

java

computes the Java hash code for a list of parameters

md2

Computes the MD2 hash function.

md2(X1, ..., Xn)

Where:

  • X1, …​, Xn are the values to be hashed.

Example
@library("hash:", "hash").
input("value1", "value2").
result(X) :- input(Y1, Y2), X = hash:md2(Y1, Y2).
@output("result").
Expected results
result("hash_value")

md5

Computes the MD5 hash function.

md5(X1, ..., Xn)

Where:

  • X1, …​, Xn are the values to be hashed.

Example
@library("hash:", "hash").
input("value1", "value2").
result(X) :- input(Y1, Y2), X = hash:md5(Y1, Y2).
@output("result").
Expected results
result("hash_value")

sha

Computes the SHA hash function.

sha(X1, ..., Xn)

Where:

  • X1, …​, Xn are the values to be hashed.

Example
@library("hash:", "hash").
input("value1", "value2").
result(X) :- input(Y1, Y2), X = hash:sha1(Y1, Y2).
@output("result").
Expected results
result("hash_value")

sha224

Computes the SHA-224 hash function.

sha224(X1, ..., Xn)

Where:

  • X1, …​, Xn are the values to be hashed.

Example
@library("hash:", "hash").
input("value1", "value2").
result(X) :- input(Y1, Y2), X = hash:sha224(Y1).
@output("result").
Expected results
result("hash_value")

sha256

Computes the SHA-256 hash function.

sha256(X1, ..., Xn)

Where:

  • X1, …​, Xn are the values to be hashed.

Example
@library("hash:", "hash").
input("value1", "value2").
result(X) :- input(Y1, Y2), X = hash:sha256(Y1, Y2).
@output("result").
Expected results
result("hash_value")

sha384

Computes the SHA-384 hash function.

sha384(X1, ..., Xn)

Where:

  • X1, …​, Xn are the values to be hashed.

Example
@library("hash:", "hash").
input("value1", "value2").
result(X) :- input(Y1, Y2), X = hash:sha384(Y1, Y2).
@output("result").
Expected results
result("hash_value")

sha512

Computes the SHA-512 hash function.

sha512(X1, ..., Xn)

Where:

  • X1, …​, Xn are the values to be hashed.

Example
@library("hash:", "hash").
input("value1", "value2").
result(X) :- input(Y1, Y2), X = hash:sha512(Y1, Y2).
@output("result").
Expected results
result("hash_value")

java

Computes the Java hash code for a list of parameters.

java(X1, ..., Xn)

Where:

  • X1, …​, Xn are the values to compute the Java hash code.

Example
@library("hash:", "hash").
input("value1", "value2").
result(X) :- input(Y1, Y2), X = hash:java(Y1, Y2).
@output("result").
Expected results
result("hash_value")