package notsha256

import "cmd/internal/notsha256"

Package notsha256 implements the NOTSHA256 algorithm, a hash defined as bitwise NOT of SHA256. It is used in situations where exact fidelity to SHA256 is unnecessary. In particular, it is used in the compiler toolchain, which cannot depend directly on cgo when GOEXPERIMENT=boringcrypto (and in that mode the real sha256 uses cgo).

Index

Constants

const BlockSize = 64

The blocksize in bytes.

const Size = 32

The size of a checksum in bytes.

Functions

func New

func New() hash.Hash

New returns a new hash.Hash computing the NOTSHA256 checksum. state of the hash.

func Sum256

func Sum256(data []byte) [Size]byte

Sum256 returns the SHA256 checksum of the data.

Source Files

sha256.go sha256block.go sha256block_generic.go

Version
v1.23.2
Published
Sep 28, 2024
Platform
js/wasm
Imports
3 packages
Last checked
now

Tools for package owners.