Skip to content

Commit

Permalink
Add rotl function
Browse files Browse the repository at this point in the history
Added Rotate left function which takes a value (a) to rotate and an amount (b) to rotate the value (a). The function returns the rotated (a).
  • Loading branch information
rogerxaic committed Apr 27, 2019
1 parent d81d1d9 commit 13bac90
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/CryptoSwift/Foundation/Utils+Foundation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ func perf(_ text: String, closure: () -> Void) {

print("\(text) \(executionTime)")
}

func rotl(_ a: UInt32, _ b: Int) -> UInt32 {
return (a << b) | (a >> (32 - b))
}

0 comments on commit 13bac90

Please sign in to comment.