diff --git a/hashids.go b/hashids.go
index <HASH>..<HASH> 100644
--- a/hashids.go
+++ b/hashids.go
@@ -10,6 +10,7 @@ import (
 	"errors"
 	"fmt"
 	"math"
+	"strings"
 )
 
 const (
@@ -62,6 +63,9 @@ func NewWithData(data *HashIDData) *HashID {
 	if len(data.Alphabet) < minAlphabetLength {
 		panic(fmt.Errorf("alphabet must contain at least %d characters", minAlphabetLength))
 	}
+	if strings.Contains(data.Alphabet, " ") {
+		panic(fmt.Errorf("alphabet may not contain spaces"))
+	}
 	// Check if all characters are unique in Alphabet
 	uniqueCheck := make(map[rune]bool, len(data.Alphabet))
 	for _, a := range data.Alphabet {
fix #<I> by not allowing spaces in alphabet