tinysum

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: MIT Imports: 3 Imported by: 1

README

tinysum

Make a CRC32 or CRC64 checksum (with or without an offset) of a string or []byte

GoDoc

go get github.com/cognusion/tinysum

Why Offsets?

There may be times you don't want your checksum to be too predictable. If you use (and store) an offset, it's still trivial for you to compare and validate, but harder for someone else to validate it, even if they know- or think they know- the match string.

Documentation

Overview

Package tinysum provides a number of quazi-primitives to assist with 32 and 64-bit CRC sums

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteSum

func ByteSum(b []byte) (tiny string)

ByteSum returns a CRC32 of the provided []byte

func ByteSum64

func ByteSum64(b []byte) (tiny string)

ByteSum64 returns a CRC64 of the provided []byte

func OffsetByteSum

func OffsetByteSum(b []byte, offset uint32) (tiny string)

OffsetByteSum returns an offset CRC32 of the provided []byte

func OffsetByteSum64

func OffsetByteSum64(b []byte, offset uint32) (tiny string)

OffsetByteSum64 returns an offset CRC64 of the provided []byte

func OffsetStringSum

func OffsetStringSum(s string, offset uint32) (tiny string)

OffsetStringSum returns an offset CRC32 of the provided string

func OffsetStringSum64

func OffsetStringSum64(s string, offset uint32) (tiny string)

OffsetStringSum64 returns an offset CRC64 of the provided string

func StringSum

func StringSum(s string) (tiny string)

StringSum returns a CRC32 of the provided string

func StringSum64

func StringSum64(s string) (tiny string)

StringSum64 returns a CRC64 of the provided string

func Sum32

func Sum32(b []byte) (sum uint64)

Sum32 returns the 32bit sum of b

func Sum64

func Sum64(b []byte) (sum uint64)

Sum64 returns the 64bit sum of b

Types

This section is empty.

Jump to

Keyboard shortcuts

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