Created
May 17, 2013 14:56
-
-
Save kylegetson/5599592 to your computer and use it in GitHub Desktop.
similar issue with leveldb (level down)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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