Skip to content

Instantly share code, notes, and snippets.

@panfu
Created August 29, 2011 03:58
Show Gist options
  • Save panfu/1177749 to your computer and use it in GitHub Desktop.
Save panfu/1177749 to your computer and use it in GitHub Desktop.
crypto = require('crypto')
md5_url = (url) -> crypto.createHash('md5').update(url).digest("hex")[0..6]
h = {}
a = []
for r in [1..100000]
z = md5_url(Math.random() + '')
if !h[z]
a.push z
h[z] = 1
console.log a.length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment