Last active
March 3, 2023 14:07
-
-
Save veridelisi/7a3f5cb6d427a7c3eadb4d0738a6e166 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.19; | |
contract Shifting { | |
function left(bytes1 x) public pure returns(bytes1 y) { | |
return y = x << 1; | |
} | |
function right(bytes1 x) public pure returns(bytes1 y) { | |
return y= x >> 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment