I am trying to understand why BITWISE AND (&) operator used instead of LOGICAL AND (&&) operator in ERC 1155 implementation.
Link - https://github.com/enjin/erc-1155/blob/master/contracts/ERC1155MixedFungible.sol
Just for more clarity, I am also stating the code here.
If someone can explain with help of an example, that would be great.
function isNonFungible(uint256 _id) public pure returns(bool) { return _id & TYPE_NF_BIT == TYPE_NF_BIT; } function isFungible(uint256 _id) public pure returns(bool) { return _id & TYPE_NF_BIT == 0; } function getNonFungibleIndex(uint256 _id) public pure returns(uint256) { return _id & NF_INDEX_MASK; } function getNonFungibleBaseType(uint256 _id) public pure returns(uint256) { return _id & TYPE_MASK; }