(value, r)
| 102 | } |
| 103 | |
| 104 | export function rotateRight(value, r) { // https://github.com/dfrankland/bitwise-rotation/blob/master/src/index.js |
| 105 | const bitWidth = 32; |
| 106 | const rotation = r & (bitWidth - 1) |
| 107 | const bitMask = (2 ** bitWidth) - 1 |
| 108 | return ( |
| 109 | (value >>> rotation) | |
| 110 | ((value << (bitWidth - rotation)) & bitMask) |
| 111 | ); // Change from signed to unsigned |
| 112 | } |
| 113 | |
| 114 | export function ordinal(i) { |
| 115 | let j = i % 10, |
no outgoing calls
no test coverage detected