package md4

import "golang.org/x/crypto/md4"

Package md4 implements the MD4 hash algorithm as defined in RFC 1320.

Deprecated: MD4 is cryptographically broken and should only be used where compatibility with legacy systems, not security, is the goal. Instead, use a secure hash like SHA-256 (from crypto/sha256).

Index

Examples

Constants

const BlockSize = 64

The blocksize of MD4 in bytes.

const Size = 16

The size of an MD4 checksum in bytes.

Functions

func New

func New() hash.Hash

New returns a new hash.Hash computing the MD4 checksum.

Example

Code:play 

package main

import (
	"fmt"
	"io"

	"golang.org/x/crypto/md4"
)

func main() {
	h := md4.New()
	data := "These pretzels are making me thirsty."
	io.WriteString(h, data)
	fmt.Printf("%x", h.Sum(nil))
}

Output:

48c4e365090b30a32f084c4888deceaa

Source Files

md4.go md4block.go

Version
v0.34.0 (latest)
Published
Feb 22, 2025
Platform
linux/amd64
Imports
3 packages
Last checked
9 hours ago

Tools for package owners.