package mask

import "strings"

func Email(email string) string {
	parts := strings.Split(email, "@")
	if len(parts) != 2 {
		return email
	}
	local := parts[0]
	if len(local) > 2 {
		local = local[:1] + "***" + local[len(local)-1:]
	} else {
		local = local[:1] + "***"
	}
	return local + "@" + parts[1]
}
