You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
wdd906
changed the title
Is there a new way to generate digest in transaction information?
Is it necessary to add a new method to generate digest in transaction information?
Apr 19, 2023
wdd906
changed the title
Is it necessary to add a new method to generate digest in transaction information?
Is it necessary to add a new method to generate digest in transaction information? as follows
Apr 19, 2023
public byte[] hashTypedData(String typeTag, byte[] data) {
byte[] typeTagBytes = String.format("%s::", typeTag).getBytes();
byte[] dataWithTag = new byte[typeTagBytes.length + data.length];
System.arraycopy(typeTagBytes, 0, dataWithTag, 0, typeTagBytes.length);
System.arraycopy(data, 0, dataWithTag, typeTagBytes.length, data.length);
Blake2b.Blake2b256 blake2b256 = new Blake2b.Blake2b256();
return blake2b256.digest(dataWithTag);
}
The text was updated successfully, but these errors were encountered: