OuterCorner / Sodium

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sodium

Platforms Carthage License

This project simply wraps libsodium into a dynamic framework for iOS and macOS.

Current libsodium version used: 1.0.18

Installation

You have a few different options:

Manual installation

  • Include the Sodium.xcodeproj as a dependency in your project. This is what the projects under Examples/ are doing. Doing this means Sodium.framework will be compiled alongside your project, including after every clean.
  • Use a pre-built Sodium.framework. You can find them under Releases.

SwiftPM

In your Package.swift, add Sodium as a dependency:

dependencies: [
  .package(url: "https://github.com/OuterCorner/Sodium", from: "1.0.18")
],

Associate the dependency with your target:

targets: [
  .target(name: "App", dependencies: ["Sodium"])
]

Usage

After importing the umbrella header:

#import <Sodium/Sodium.h>

You can simply start using libsodium APIs as usual.

crypto_secretbox_keygen(key);
randombytes_buf(nonce, sizeof(nonce));

See example projects under Examples/.

License

This project is licensed under the MIT License - see LICENSE.

Note the underlying libsodium library LICENSE still applies when using this project.

About

License:MIT License


Languages

Language:Shell 51.6%Language:Swift 29.3%Language:Objective-C 14.1%Language:C 5.0%