package
7.17.28
Repository: https://github.com/elastic/beats.git
Documentation: pkg.go.dev

# README

flowhash

The flowhash Go package provides Community ID flow hashing.

See https://github.com/corelight/community-id-spec

Usage

import "github.com/adriansr/flowhash"

func ExampleCommunityIDHash() {
	flow := flowhash.Flow{
		SourceIP:        net.ParseIP("10.1.2.3"),
		DestinationIP:   net.ParseIP("8.8.8.8"),
		SourcePort:      63521,
		DestinationPort: 53,
		Protocol:        17,
	}
	fmt.Println(flowhash.CommunityID.Hash(flow))
	// Output: 1:R7iR6vkxw+jaz3wjDfWMWooBdfc=
}

# Packages

# Functions

NewCommunityID allows to instantiate a flow hasher with custom settings.

# Variables

Base64Encoding uses Base64 to encode the checksum, including padding characters.
CommunityID is a flow hasher instance using the default values in the community ID specification.
HexEncoding encodes the checksum in hexadecimal.

# Structs

Flow is the representation of a flow.

# Interfaces

Encoding is used to encode the flow hash.
Hasher is an interface that provides a method to hash flows.