+ buf := slices.Concat(fieldCount, fieldBytes)
+ if a.readOffset >= len(buf) {
+ return 0, io.EOF // All bytes have been read
+ }
+
+ n := copy(p, buf[a.readOffset:])
+ a.readOffset += n
+
+ return n, nil
+}
+
+// HashAndSalt generates a password hash from a users obfuscated plaintext password
+func HashAndSalt(pwd []byte) string {
+ hash, _ := bcrypt.GenerateFromPassword(pwd, bcrypt.MinCost)
+
+ return string(hash)