"Sputnik" help  
Sputnik Help
HashUpdate(<hashContext>, <data>)


Updates a hash context with additional data during a hashing operation. This function is used to incrementally hash data, allowing for the processing of large datasets in smaller chunks.


<hashContext> The hash context to be updated.
<data> The data to be included in the hash computation.

Return Value

Success: Returns true.
Failure: Returns false.


Use HashUpdate in conjunction with HashInit to incrementally hash data. It is particularly useful for hashing large datasets in a memory-efficient manner, processing the data in smaller segments.


HashInit, HashFinal, HashCopy, HashUpdateFile, HashUpdateStream


Example of usage:

my $hash = HashInit("gost");
HashUpdate($hash, "Cat");
say HashFinal($hash);

my $hash = HashInit("gost");
HashUpdate($hash, "Cat");
HashUpdate($hash, "Dog");
say HashFinal($hash);

// CEA32112D34163EB607E8F19CC8C8E2D2B11268088D35F71757AABA6A11D40B8
// 5D32789DD6F8F25FBDEE44F875FABC1556AE8A97F3619EE8CE04D548595D0973

In the given example, two hash computations are showcased using the GOST hash algorithm in Sputnik. In the first instance, the hash context is initialized with the string "Cat," and the resulting hash is calculated and printed. In the second case, the same hash context is updated with an additional string, "Dog," before finalizing and printing the resulting hash. The hash values demonstrate the unique fingerprints generated by the GOST algorithm for the given input data. The ability to update the hash context allows for the incremental hashing of data, and each distinct input produces a different hash output, highlighting the cryptographic strength of the GOST hash function.

Cheryl (uberfox@hotmail.com)