PUF (Pejorative Username Filter) is a package built in Go that uses bloom's filter to validate if a specific username is definitely not present in a dataset that might represent a pejorative username that shouldn't be used.
With puf, you can quickly check a username against our hand-picked dataset to make sure it's cool with community rules. That way, we all get to hang out in a safer space. We're always tweaking our dataset to keep up with the latest hacks.
With a correctly configured Go toolchain:
go get -u github.com/ecorreiax/puf
Kick things off by passing a username string to the Check()
method. This returns a boolean, tipping you off if the username is invalid or not.
func createUser() {
u := "username"
invalid := puf.Check(u)
if invalid {
// abort creation
}
// continue creation
}
This project is under MIT License.