sm3

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(b []byte) []byte

Hash hash implement

Example
var msg string = "message"
var sm3 Context
sm3.Reset()
sm3.Append([]byte(msg))
hash := sm3.Final()
fmt.Printf("%x", hash)
Output:

1756ac517f85ffda751dcdebf3c89575272fc56904f9baad983ec44c36feac7b

Types

type Context

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

Context is the SM3 context

func NewContext

func NewContext() *Context

NewContext create a Context

func (*Context) Append

func (sm3 *Context) Append(data []byte)

Append add new data for sm3 hash

func (*Context) Final

func (sm3 *Context) Final() []byte

Final calculate sm3 hash algorithm

func (*Context) Reset

func (sm3 *Context) Reset()

Reset clear data and reset state

Jump to

Keyboard shortcuts

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