adler32

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

adler32パッケージはAdler-32チェックサムを実装しています。

これはRFC 1950で定義されています:

Adler-32はバイトごとに累積される2つの合計で構成されています: s1は
すべてのバイトの合計で、s2はすべてのs1の値の合計です。両方の合計は
65521でモジュロ演算が行われます。s1は1で初期化され、s2はゼロです。Adler-32
チェックサムはs2*65536 + s1として、最も重要なバイトを最初に(ネットワークの)順序で格納されます。

Index

Constants

View Source
const Size = 4

Adler-32チェックサムのバイト単位のサイズ。

Variables

This section is empty.

Functions

func Checksum

func Checksum(data []byte) uint32

ChecksumはdataのAdler-32チェックサムを返します。

func New

func New() hash.Hash32

NewはAdler-32チェックサムを計算する新しいhash.Hash32を返します。 Sumメソッドは値をビッグエンディアンのバイト順で配置します。 返されるHash32は、 encoding.BinaryMarshalerencoding.BinaryUnmarshaler も実装しており、 ハッシュの内部状態をマーシャリングおよびアンマーシャリングすることができます。

Types

This section is empty.

Jump to

Keyboard shortcuts

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