https://github.com/soffes/Camo
Swift client for Camo
https://github.com/soffes/Camo
carthage ios macos swift tvos watchos
Last synced: over 1 year ago
JSON representation
Swift client for Camo
- Host: GitHub
- URL: https://github.com/soffes/Camo
- Owner: soffes
- License: mit
- Archived: true
- Created: 2015-12-05T22:07:33.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-28T12:33:30.000Z (over 9 years ago)
- Last Synced: 2024-10-23T22:18:24.525Z (over 1 year ago)
- Topics: carthage, ios, macos, swift, tvos, watchos
- Language: Swift
- Size: 20.5 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.markdown
- License: LICENSE
Awesome Lists containing this project
README
# Camo
[](https://github.com/soffes/Camo/releases)

[](https://github.com/Carthage/Carthage)
Swift client for [Camo](https://github.com/atmos/camo).
Camo depends on [Crypto](https://github.com/soffes/Crypto). Released under the MIT license.
## Installation
[Carthage](https://github.com/carthage/carthage) is the recommended way to install Crypto. Add the following to your Cartfile:
``` ruby
github "soffes/Camo"
```
## Usage
```swift
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"
```