Package md4 implements the MD4 cryptographic hash algorithm as per IETF RFC-1320, for the Go programming-language.
Find a file
2025-09-03 06:04:23 -07:00
auxiliary.go auxiliary functions 2025-07-18 15:49:21 -07:00
blocksize.go md4.BlockSize 2025-07-18 15:46:24 -07:00
errors.go errors 2025-07-18 15:48:16 -07:00
go.mod codeberg 2025-09-03 06:04:23 -07:00
go.sum go.* 2025-07-18 15:43:36 -07:00
hasher.go corrected typo in docs 2025-07-19 13:54:31 -07:00
LICENSE initial commits 2025-07-18 15:39:53 -07:00
md4transform.go md4transform() 2025-07-18 16:00:31 -07:00
new.go md4.New() 2025-07-19 09:01:09 -07:00
new_example_test.go codeberg 2025-09-03 06:04:23 -07:00
nothing.go nothing digest 2025-07-19 06:38:33 -07:00
README.md codeberg 2025-09-03 06:04:23 -07:00
sconstants.go s constants 2025-07-18 15:43:03 -07:00
size.go md4.Size 2025-07-19 09:07:57 -07:00
sum.go corrected typo in docs 2025-07-19 11:05:12 -07:00
sum_example_test.go codeberg 2025-09-03 06:04:23 -07:00
sum_test.go codeberg 2025-09-03 06:04:23 -07:00
transformations.go transformation functions 2025-07-18 15:52:57 -07:00

go-md4

Package md4 implements the MD4 cryptographic hash algorithm as per IETF RFC-1320, for the Go programming language.

Note that MD4 is no longer considered secure. However, it may still be useful for some non-secure (and historical) use-cases.

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/codeberg.org/reiver/go-md4

GoDoc

Examples

Here is a simple example of calculating the MD4 digest of data contained in a []byte:

import "codeberg.org/reiver/go-md4"

// ...

var data []byte = []byte("Hello world!")

digest := md4.Sum(data)

Here is a more complex example of putting data into the an MD4 hasher in multiple pieces.

import "codeberg.org/reiver/go-md4"

// ...

hasher := md4.New()

// This is equivalent to writing:
//
//	[]byte("once+twice-thrice_fource")
hasher.Write([]byte("once"))
hasher.Write([]byte("+"))
hasher.Write([]byte("twice"))
hasher.Write([]byte("-"))
hasher.Write([]byte("thrice"))
hasher.Write([]byte("_"))
hasher.Write([]byte("fource"))

digest := hasher.Sum(nil)

Import

To import package md4 use import code like the following:

import "codeberg.org/reiver/go-md4"

Installation

To install package md4 do the following:

GOPROXY=direct go get codeberg.org/reiver/go-md4

Author

Package md4 was written by Charles Iliya Krempeaux