Skip to content

Instantly share code, notes, and snippets.

@kylegetson
Created May 17, 2013 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylegetson/5599592 to your computer and use it in GitHub Desktop.
Save kylegetson/5599592 to your computer and use it in GitHub Desktop.
similar issue with leveldb (level down)
var levelup = require('levelup')
, crypto = require('crypto');
var db = levelup('./mydb', {cacheSize: 0});
function uniqueGet(num){
if( num == 0 ) return;
var hash = crypto.createHash('md5').update( num.toString() ).digest("hex");
db.get(hash, function(err,result){
return uniqueGet(--num);
});
}
uniqueGet(5000000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment