[英]How long Ethereum hash length? (block, transaction, address)
I checked hash length from node data, like below(include '0x').我从节点数据中检查了哈希长度,如下所示(包括“0x”)。
Is it always a fixed length?它总是固定的长度吗? Or is it variable length?
还是可变长度?
Yes, it's always fixed length.是的,它总是固定的长度。
Block hash is calculated using the keccak256 algorithm that always results in 32 bytes (64 hex characters prepended by 0x
) no matter the input length.块哈希是使用keccak256算法计算的,无论输入长度如何,该算法始终会产生 32 个字节(以
0x
的 64 个十六进制字符)。
Same goes for transaction hash and receipt root hash.交易哈希和收据根哈希也是如此。
An address is always the last 20 bytes (40 hex charaters prepended by 0x
) of the public key hash.地址始终是公钥哈希的最后 20 个字节(40 个以
0x
的十六进制字符)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.