recover_message_hash
方法定义
@staticmethod
def recover_message_hash(message_hash: HexBytes, signature: HexBytes) -> Optional[SignedMessageData]参数说明
参数
类型
说明
返回值
字段
类型
说明
示例代码
# 恢复消息哈希签名者
message_hash = HexBytes("0x...") # 32 字节的消息哈希
signature = HexBytes("0x...") # 65 字节的签名
signed_data = Utils.recover_message_hash(message_hash, signature)
if signed_data:
print(f"Message Hash: {signed_data.message_hash.hex()}")
print(f"Signer: {signed_data.signer}")
print(f"Signature: {signed_data.signature_data.signature.hex()}")最后更新于