File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,15 @@ function popCount(uint256 x) internal pure returns (uint256 c)
5353
5454Returns the number of set bits in ` x ` .
5555
56+ ### countZeroBytes(uint256)
57+
58+ ``` solidity
59+ function countZeroBytes(uint256 x) internal pure returns (uint256 c)
60+ ```
61+
62+ Returns the number of zero bytes in ` x ` .
63+ To get the number of non-zero bytes, simply do ` 32 - countZeroBytes(x) ` .
64+
5665### isPo2(uint256)
5766
5867``` solidity
Original file line number Diff line number Diff line change @@ -81,8 +81,8 @@ library LibBit {
8181 }
8282 }
8383
84- /// @dev Returns the number of zero bits in `x`.
85- /// To get the number of non-zero bytes, simply do `32 - countZeroBytes(x)`
84+ /// @dev Returns the number of zero bytes in `x`.
85+ /// To get the number of non-zero bytes, simply do `32 - countZeroBytes(x)`.
8686 function countZeroBytes (uint256 x ) internal pure returns (uint256 c ) {
8787 /// @solidity memory-safe-assembly
8888 assembly {
You can’t perform that action at this time.
0 commit comments