ed2k

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

README

ed2k-go

Go Reference

Documentation

Overview

Package ed2k implements the eD2k hash.

See https://en.wikipedia.org/wiki/Ed2k_URI_scheme.

Index

Constants

View Source
const BlockSize = md4.BlockSize

The blocksize of eD2k in bytes.

View Source
const ChunkSize = 9728000

The chunk size of eD2k in bytes.

View Source
const Size = md4.Size

The size of an eD2k checksum in bytes.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hash

type Hash struct {
	// contains filtered or unexported fields
}

A Hash is an implementation of hash.Hash for eD2k.

func New

func New() *Hash

New returns a new Hash computing the eD2k checksum.

func (*Hash) BlockSize

func (h *Hash) BlockSize() int

BlockSize returns the hash's underlying block size. The Write method must be able to accept any amount of data, but it may operate more efficiently if all writes are a multiple of the block size.

func (*Hash) Reset

func (h *Hash) Reset()

Reset resets the Hash to its initial state.

func (*Hash) Size

func (h *Hash) Size() int

Size returns the number of bytes Sum will return.

func (*Hash) Sum

func (h *Hash) Sum(b []byte) []byte

Sum appends the current hash to b and returns the resulting slice. It does not change the underlying hash state.

func (*Hash) Write

func (h *Hash) Write(p []byte) (int, error)

Write adds more data to the running hash. It never returns an error.

Jump to

Keyboard shortcuts

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