Skip to content

Instantly share code, notes, and snippets.

View nbutton23's full-sized avatar

Nathan Button nbutton23

  • Cruise
  • Salt Lake City, UT
View GitHub Profile
// Current using the released interface
// LeveledLogger interface implements the basic methods that a logger library needs
type LeveledLogger interface {
Error(string, ...interface{})
Info(string, ...interface{})
Debug(string, ...interface{})
Warn(string, ...interface{})
}
// Info leveled log message
package tags
import (
"bufio"
"io"
"strings"
)
func getTagsFromString(msg string) ([]string, error) {
r := bufio.NewReader(strings.NewReader(msg))
func dictionaryMatch(password string, dictionaryName string, rankedDict map[string]int) []match.Match {
length := len(password)
var results []match.Match
pwLower := strings.ToLower(password)
for i := 0; i < length; i++ {
for j := i; j < length; j++ {
word := pwLower[i : j+1]
if val, ok := rankedDict[word]; ok {
matchDic := match.Match{Pattern: "dictionary",

Keybase proof

I hereby claim:

  • I am nbutton23 on github.
  • I am nbutton (https://keybase.io/nbutton) on keybase.
  • I have a public key ASAgOFx7khSp3pnWF0WQ2TrdAhMALQt-B3wNzQlueprOtwo

To claim this, I am signing this object: