Skip to content

Instantly share code, notes, and snippets.

@veridelisi
Last active March 3, 2023 14:07
Show Gist options
  • Save veridelisi/7a3f5cb6d427a7c3eadb4d0738a6e166 to your computer and use it in GitHub Desktop.
Save veridelisi/7a3f5cb6d427a7c3eadb4d0738a6e166 to your computer and use it in GitHub Desktop.
// 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