Skip to content

Instantly share code, notes, and snippets.

Ahmed Osama AhmedOS

Block or report user

Report or block AhmedOS

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AhmedOS
AhmedOS / PushIDGenerator.swift
Last active Mar 3, 2019
Swift 4 port of Firebase Push ID generator
View PushIDGenerator.swift
// original: https://gist.github.com/mikelehen/3596a30bd69384624c11
class PushIDGenerator {
private init() { }
static private let PUSH_CHARS = Array("-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz")
static private var lastPushTime: UInt64 = 0
static private var lastRandChars = Array<Int>(repeating: 0, count: 12)
static func generate() -> String {
You can’t perform that action at this time.