Method __builtin.Nettle.Hash()->hash()


Method hash

string(8bit) hash(string(8bit) data)

Description

Works as a (possibly faster) shortcut for e.g. State(data)->digest(), where State is the hash state class corresponding to this Hash.

Parameter data

String to hash.

See also

Stdio.File, State()->update() and State()->digest().


Method hash

variant string(8bit) hash(Stdio.File|Stdio.Buffer|String.Buffer|System.Memory source, int(0..)|void bytes)

Description

Works as a (possibly faster) shortcut for e.g. State(   obj->read() )->digest(), where State is the hash state class corresponding to this Hash.

Parameter source

Object to read some data to hash from.

Parameter bytes

The number of bytes of the source object that should be hashed. Zero and negative values are ignored and the whole file is hashed. Support for negative values is deprecated.

Stdio.File, Stdio.Buffer, String.Buffer, System.Memory