MCPcopy Index your code
hub / github.com/btcsuite/btcd / opcodeSha1

Function opcodeSha1

txscript/opcode.go:1891–1900  ·  view source on GitHub ↗

opcodeSha1 treats the top item of the data stack as raw bytes and replaces it with sha1(data). Stack transformation: [... x1] -> [... sha1(x1)]

(op *opcode, data []byte, vm *Engine)

Source from the content-addressed store, hash-verified

1889//
1890// Stack transformation: [... x1] -> [... sha1(x1)]
1891func opcodeSha1(op *opcode, data []byte, vm *Engine) error {
1892 buf, err := vm.dstack.PopByteArray()
1893 if err != nil {
1894 return err
1895 }
1896
1897 hash := sha1.Sum(buf)
1898 vm.dstack.PushByteArray(hash[:])
1899 return nil
1900}
1901
1902// opcodeSha256 treats the top item of the data stack as raw bytes and replaces
1903// it with sha256(data).

Callers

nothing calls this directly

Calls 2

PopByteArrayMethod · 0.80
PushByteArrayMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…