mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 13:58:05 +00:00
13 lines
238 B
Go
13 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])
|
||
|
}
|