javascript algorithm for ruby-entropy.strength