Documentation ¶ Index ¶ func Hash(b []byte) []byte type Context func NewContext() *Context func (sm3 *Context) Append(data []byte) func (sm3 *Context) Final() []byte func (sm3 *Context) Reset() Examples ¶ Hash 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 Source Files ¶ View all Source files sm3.go Click to show internal directories. Click to hide internal directories.