// Creates a unique hash for the type, ports, and protocol, used as a key in
// maps
Creates a unique hash for the type, ports, and protocol, used as a key in
maps
// Creates a unique hash for the type ports and protocol used as a key in // maps
func idHash(rType, protocol string, toPort, fromPort int64, self bool) string {
	var buf bytes.Buffer
	buf.WriteString(fmt.Sprintf("%s-", rType))
	buf.WriteString(fmt.Sprintf("%d-", toPort))
	buf.WriteString(fmt.Sprintf("%d-", fromPort))
	buf.WriteString(fmt.Sprintf("%s-", strings.ToLower(protocol)))
	buf.WriteString(fmt.Sprintf("%t-", self))
	return fmt.Sprintf("rule-%d", hashcode.String(buf.String()))
}
func idHash ( rType , protocol string , toPort , fromPort int64 , self bool ) string { var buf bytes . Buffer buf . WriteString ( fmt . Sprintf ( " " , rType ) ) buf . WriteString ( fmt . Sprintf ( " " , toPort ) ) buf . WriteString ( fmt . Sprintf ( " " , fromPort ) ) buf . WriteString ( fmt . Sprintf ( " " , strings . ToLower ( protocol ) ) ) buf . WriteString ( fmt . Sprintf ( " " , self ) ) return fmt . Sprintf ( " " , hashcode . String ( buf . String ( ) ) ) }
Creates a unique hash for the type, ports, and protocol, used as a key in
maps
Creates a unique hash for the type ports and protocol used as a key in maps