Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

uniqid emulator

  • Loading branch information...
commit 5f1ba6f16e56523d5dafe81e2b9e18352de1d269 1 parent 9ef5958
joernchen of Phenoelit authored April 06, 2012

Showing 1 changed file with 10 additions and 0 deletions. Show diff stats Hide diff stats

  1. 10  ruby/uniqid.rb
10  ruby/uniqid.rb
... ...
@@ -0,0 +1,10 @@
  1
+#!/usr/bin/env ruby
  2
+# generate all PHP uniqids for a given second
  3
+
  4
+from = Time.new(ARGV[0].to_i,ARGV[1].to_i,ARGV[2].to_i,ARGV[3].to_i,ARGV[4].to_i,ARGV[5].to_i)
  5
+
  6
+
  7
+0.upto 0xfffff do |i|
  8
+	uniqid = sprintf("%08x%05x",from.tv_sec,i);
  9
+	puts uniqid 
  10
+end

0 notes on commit 5f1ba6f

Please sign in to comment.
Something went wrong with that request. Please try again.