[]; var length = password.length; var trigram_count = length - 3; for (var i = 0; i < trigram_count; i++) { var slice = password.slice(i, i+3); var gram = {'keys':[slice]}; gram[slice] = 1; trigrams.push(gram); } return trigrams; } Saturday, October 22, 11 We want to break each password into a list of trigrams.