Package org.symbol.sdk.symbol
Class Metadata
java.lang.Object
org.symbol.sdk.symbol.Metadata
- Metadata
- Symbol metadata helpers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic longgenerateKey(String seed) Generates a metadata key from a string seed: the first 8 bytes ofSHA3-256(seed)read as a unsigned 64-bit integer with the top bit forced to one (matching the SDK V2 implementation).static byte[]updateValue(byte[] oldValue, byte[] newValue) Creates a metadata payload that updatesoldValuetonewValue: the XOR of the two values up to the shorter length, followed by the remaining bytes of the longer value.
-
Method Details
-
generateKey
- Metadata.metadataGenerateKey
- Generates a metadata key from a string seed: the first 8 bytes of
SHA3-256(seed)read as a unsigned 64-bit integer with the top bit forced to one (matching the SDK V2 implementation).
- Parameters:
seed- Metadata key seed.- Returns:
- Metadata key (64-bit two's-complement bit pattern).
-
updateValue
public static byte[] updateValue(byte[] oldValue, byte[] newValue) - Metadata.metadataUpdateValue
- Creates a metadata payload that updates
oldValuetonewValue: the XOR of the two values up to the shorter length, followed by the remaining bytes of the longer value.
- Parameters:
oldValue- Old metadata value, ornullwhen none exists.newValue- New metadata value.- Returns:
- Metadata payload.
-