sysvsum

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 SYSV checksum algorithm SYSV checksum is also known as UNIX SYStem V checksum, sum -s

Index

Examples

Constants

View Source
const Size = 2

The size of an SYSV checksum value

Variables

This section is empty.

Functions

func New

func New() unixsums.Hash16

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

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

sum: 4330

func Sysvsum

func Sysvsum(data []byte) uint16

Sysvsum returns the SYSV checksum value of a given byte array

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

sum: 4377

Types

This section is empty.

Jump to

Keyboard shortcuts

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