Skip to content

Commit

Permalink
Add a license and readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelvoss committed May 2, 2021
1 parent 9c37a84 commit aed06b7
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Marcel Voss

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
# Base62
[![CI](https://github.com/marcelvoss/Base62/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/marcelvoss/Base62/actions/workflows/ci.yml)

A description of this package.
Base62 is a tiny package for [Base62](https://en.wikipedia.org/wiki/Base62) encoding/decoding values. It is tested, documented, easy-to-use and supports Apple Platforms, as well as Linux.

## Installation
Base62 is distributed using the Swift Package Manager. To install it into a project, add it as a dependency within your `Package.swift` manifest:

```swift
let package = Package(
...
dependencies: [
.package(url: "https://github.com/marcelvoss/Base62.git", from: "0.1.0")
],
...
)
```

Then import Base62 wherever you’d like to use it:

```swift
import Base62
```

## Usage
Using Base62 is incredibly easy, as it focusses on a single responsibility and does that nicely.

Base62 ships with a single object that provides encoding and decoding functionality.

```swift
let base62Encoded = Base62.encode(2021)
// 2021 == "wz"

let base62Decoded = Base62.decode("GitHub")
// "GitHub" == 38750631667
```

There are also extensions for `String` and `Int` available, if you prefer to use them rather than the `Base62` object directly.

0 comments on commit aed06b7

Please sign in to comment.