sha256d

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: GPL-3.0 Imports: 2 Imported by: 3

README

SHA-256d
========

An implementation of the SHA-256d hash for the Go programming language.

Copyright (C) 2013  Jochen Voss

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

The homepage of this package is at http://www.seehuhn.de/pages/sha256d .
Please send any comments or bug reports to the program's author,
Jochen Voss <voss@seehuhn.de> .

Overview
--------

This package provides an implementation of the SHA-256d hash algorithm
(also known as "double SHA-256") for the Go programming language.
SHA-256d is a cryptographic hash, first proposed by Ferguson and
Schneier in the book "Practical Cryptography".  The SHA-256d hash is
used in the Bitcoin protocol and in the Fortuna random number
generator.

The SHA-256d hash is obtained by applying the SHA-256 hash twice,
i.e. by first applying SHA-256 to the data and then again to the
resulting hash.

Installation
------------

::

    go get github.com/seehuhn/sha256d

Usage
-----

The sha256d package implements the standard hash.Hash interface.
Example::

    hash := sha256d.New()
    n, _ := hash.Write([]byte("hello"))
    hashVal := hash.Sum(nil)

Documentation

Overview

Package sha256d implements the SHA-256d hash algorithm. This algorithm, obtained by applying SHA-256 to the data and then again to the resulting hash, was first proposed by Ferguson and Schneier in the book "Practical Cryptography". It is used in the Bitcoin protocol and in the Fortuna random number generator.

Index

Constants

View Source
const (
	// Size is the size of a SHA-256d checksum in bytes.
	Size = 32

	// BlockSize is the internal blocksize of SHA-256d in bytes.
	BlockSize = 64
)

Variables

This section is empty.

Functions

func New

func New() hash.Hash

New returns a new hash.Hash computing the SHA-256d checksum.

Types

This section is empty.

Jump to

Keyboard shortcuts

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