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

Function rotateLeft

Hashes/SHA1.js:57–59  ·  view source on GitHub ↗

* Rotates string representation of bits to the left * * @param {string} bits - string representation of bits * @param {int} turns - number of rotations to make * @return {string} - string representation of bits after rotation * * @example * rotateLeft("1011", 3); // "1101"

(bits, turns)

Source from the content-addressed store, hash-verified

55 * rotateLeft("1011", 3); // "1101"
56 */
57function rotateLeft(bits, turns) {
58 return bits.substr(turns) + bits.substr(0, turns)
59}
60
61/**
62 * Pre-processes message to feed the algorithm loop

Callers 1

SHA1Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected