Skip to content

Instantly share code, notes, and snippets.

@tabatkins
Created October 22, 2014 18:07
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 tabatkins/8c0cb8043dbb2787d59a to your computer and use it in GitHub Desktop.
Save tabatkins/8c0cb8043dbb2787d59a to your computer and use it in GitHub Desktop.
All strings [a-z]+ of length N or less, in lexicographic order
function gen(N) {
var strings = [];
var max = Math.pow(36, N);
for(var i = 10; i < max; i++) {
var candidate = i.toString(36);
if(/^[a-z]+$/.test(candidate)) {
strings.push(candidate);
}
}
return strings;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment