bsdsum

package
v0.0.0-...-8956429 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2013 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package bsdsum implements the BSD checksum algorithm BSD checksum is also known as UNIX sum

Index

Examples

Constants

View Source
const Size = 2

The size of a BSD checksum value

Variables

This section is empty.

Functions

func Bsdsum

func Bsdsum(data []byte) uint16

Bsdsum returns the BSD checksum of the given byte array

Example
data := []byte("Go is expressive, concise, clean, and efficient.")
fmt.Printf("sum: %d", Bsdsum(data))
Output:

sum: 8092

func New

func New() unixsums.Hash16

New returns a new hash.Hash computing the BSD checksum value

Example
c := New()
io.WriteString(c, "Go is an open source programming environment.")
fmt.Printf("sum: %d", c.Sum16())
Output:

sum: 16973

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL