Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block swftvsn

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
swftvsn /
Created Mar 15, 2017
Firebase Java Push Id Generator
package firebase;
public class FirebasePushIdGenerator {
// Modeled after base64 web-safe chars, but ordered by ASCII.
private final static String PUSH_CHARS = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
// Timestamp of last push, used to prevent local collisions if you push twice in one ms.
private static long LAST_PUSH_TIME = 0L;
You can’t perform that action at this time.