Home Contents | # hash:finish | Cipher/Hash | Core4 Lua Commands

## SYNOPSIS

data = hash:finish()

## DESCRIPTION

The Core4 system includes a copy of mbed TLS.

Completes a hash calculation and returns the result as a string.

The object hash must have been properly initialized with a supported algorithm.

When the result has been retrieved, the internal object state is cleared. The next call to hash:update() will be processed as if the object had just been initialized.

## RETURN VALUE

On success, returns a data string.

On failure, returns nil, a string describing the error and the mbedtls error code number.

## SEE ALSO

cipher.hash(), hash:init(), hash:update()