blockchain - Can hashing be done in compact on the client side using persistentHash? - Stack Overflow

admin2025-04-04  1

I'm using Midnight and learning compact. I'm hoping to get some clarification on the persistentHash function (export declare function persistentHash<a>(rt_type: CompactType<a>, value: a): Uint8Array;) , especially for rt_type

Is this possible to do the same hashing in Compact on the client side? Can persistentHash be used to do the same thing?

export enum Role {
    Owner,
    None
};    
const roleHash = persistent_hash<Vector<1, Role>>([Role.Owner]);
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1743757865a217723.html

最新回复(0)