neo-go/pkg/core/interop/interopnames/convert.go
2020-08-14 13:54:11 +03:00

12 lines
238 B
Go

package interopnames
import (
"crypto/sha256"
"encoding/binary"
)
// ToID returns an identificator of the method based on its name.
func ToID(name []byte) uint32 {
h := sha256.Sum256(name)
return binary.LittleEndian.Uint32(h[:4])
}