Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 554 Bytes

README.md

File metadata and controls

18 lines (13 loc) · 554 Bytes

Swift Shortkey Generator

This tiny library helps you to generate for you server or client side swift application short YouTube like IDs (e.g. R-aF2RGNTaY). Shortkeys are fixed lenght and URL-safe.

Use

Example usage:

do {
            let shortkey = try generateRandomBase64Bytes()
            return shortkey
        } catch {
            throw error
        }

Shortkeys are random generated bytes string then encoded in Base64. They are supposed to use on exposed IDs in API to prevent enumeration, evaluation of items numbers...