You are reading a single comment by @chalkers and its replies. Click here to read the full conversation.
  • I created a git repo with tests and this is the function we got to get it working:

    module.exports = function rotate(value) {
        var rotated = value >> 1;
        // Check to see if the first bit was set...
        if (1 & value) {
        	//...flip the furthest bit on.
        	rotated += (1 << 7);
        }
        return rotated;
    };
    
About

Avatar for chalkers @chalkers started