Skip to content

Instantly share code, notes, and snippets.

View jfbyers's full-sized avatar

Edu jfbyers

View GitHub Profile
package com.firebase.utils;
import java.util.Date;
/**
* Fancy ID generator that creates 20-character string identifiers with the
* following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't