MCPcopy Index your code
hub / github.com/TheAlgorithms/JavaScript / rotateLeft

Function rotateLeft

Hashes/MD5.js:54–56  ·  view source on GitHub ↗

* Rotates the bits to the left * * @param {number} bits - 32 bit number * @param {number} turns - number of rotations to make * @return {number} - number after bits rotation * * @example * rotateLeft(0b1011, 3); // 0b1011000

(bits, turns)

Source from the content-addressed store, hash-verified

52 * rotateLeft(0b1011, 3); // 0b1011000
53 */
54function rotateLeft(bits, turns) {
55 return (bits << turns) | (bits >>> (32 - turns))
56}
57
58/**
59 * Converts Uint8Array to Uint32Array

Callers 1

MD5Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected