An open API service indexing awesome lists of open source software.

https://github.com/soffes/base62

Swift base62 library
https://github.com/soffes/base62

ios macos swift tvos watchos

Last synced: about 1 year ago
JSON representation

Swift base62 library

Awesome Lists containing this project

README

          

# Base62

Swift [Base62](https://en.wikipedia.org/wiki/Base62) library.

## Usage

Simply import the library and you're good to go.

```swift
import Base62

encode(integer: 123) // "1z"
decode(string: "funky") // 619367412
```

If you prefer, you can use `Base62.encode` instead of just `encode`.

It’s worth noting that you can’t decode an string with a value greater than `Int.max`.

## Thanks

Thanks to the [base62 gem](https://github.com/jtzemp/base62) for a reference implementation.