文字
分享

  • import "hash/adler32"

  • 概述

  • 索引

概述

Adler32 包实现 Adler-32 校验和。

它在RFC 1950中定义:

Adler-32 is composed of two sums accumulated per byte: s1 is
the sum of all bytes, s2 is the sum of all s1 values. Both sums
are done modulo 65521. s1 is initialized to 1, s2 to zero.  The
Adler-32 checksum is stored as s2*65536 + s1 in most-significant-byte first (network) order.

索引

  • 常量

  • func Checksum(data []byte) uint32

  • func New() hash.Hash32

包文件

adler32.go

常量

Adler-32 校验和的大小(以字节为单位)。

const Size = 4

func Checksum

func Checksum(data []byte) uint32

校验和返回数据的 Adler-32 校验和。

func New

func New() hash.Hash32

New 返回一个新的 hash.Hash32 ,用于计算 Adler-32 校验和。它的 Sum 方法将以 big-endian 字节顺序排列值。

上一篇:hash(散列)下一篇:hash/crc32