Swift client for Camo.
Camo depends on Crypto. Released under the MIT license.
Carthage is the recommended way to install Crypto. Add the following to your Cartfile:
github "soffes/Camo"
import Camo
// Setup Camo with your secret and base URL.
// You can also optionally set the HMAC algorithm. The default is SHA1
let camo = Camo(secret: "something-secret", baseURL: NSURL(string: "https://camo.example.com/")!)
// Get a URL to sign
let imageURL = NSURL(string: "http://soffes-assets.s3.amazonaws.com/images/Sam-Soffes.jpg")!
// Get a camo'd URL
camo.sign(URL: URL) // "https://camo.example.com/c426621ed24dd05c47d766e5372de822c5601789?url=http://soffes-assets.s3.amazonaws.com/images/Sam-Soffes.jpg"