"Sputnik" help  
Sputnik Help
NbtHash(<nbt>)

Description

Calculates the CRC32 hash of the entire NBT (Named Binary Tag) object.

Parameters

<nbt> The NBT object for which the hash is to be calculated.

Return Value

Success: Returns an integer representing the CRC32 hash of the NBT object.
Failure: Returns 0.

Remarks

The NbtHash function calculates the CRC32 hash of the entire NBT object. The CRC32 hash is a checksum algorithm that produces a unique value for the input data. It is commonly used for error checking and data integrity verification.

The hash value will always be the same for the same data contained in the NBT object. If two NBT objects have identical data, their CRC32 hashes will also be identical.

Related

Example

Example of usage:

my $nbt = Nbt((Int32)42, "myTag");
say NbtHash($nbt);
my $nbt = Nbt((Int32)42, "myTag");
say NbtHash($nbt);
my $nbt = Nbt((Int32)42, "TESTY");
say NbtHash($nbt);
// PRINTS
// 769650644
// 769650644
// -1265520253

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org