mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-18 05:44:43 +00:00
16 lines
373 B
Go
16 lines
373 B
Go
|
package crypto
|
||
|
|
||
|
import (
|
||
|
"github.com/nspcc-dev/neo-go/pkg/core/interop"
|
||
|
"github.com/nspcc-dev/neo-go/pkg/crypto/hash"
|
||
|
"github.com/nspcc-dev/neo-go/pkg/vm"
|
||
|
)
|
||
|
|
||
|
// Sha256 returns sha256 hash of the data.
|
||
|
func Sha256(ic *interop.Context, v *vm.VM) error {
|
||
|
msg := getMessage(ic, v.Estack().Pop().Item())
|
||
|
h := hash.Sha256(msg).BytesBE()
|
||
|
v.Estack().PushVal(h)
|
||
|
return nil
|
||
|
}
|