Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soffes/Camo
Swift client for Camo
https://github.com/soffes/Camo
carthage ios macos swift tvos watchos
Last synced: 3 months 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 (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-28T12:33:30.000Z (about 8 years ago)
- Last Synced: 2024-05-09T20:06:40.052Z (8 months 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
[![Version](https://img.shields.io/github/release/soffes/Camo.svg)](https://github.com/soffes/Camo/releases)
![Swift Version](https://img.shields.io/badge/swift-3.0.1-orange.svg)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](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"
```