Open ameeratgithub opened 8 months ago
It's not convenient to use hashing functions like hash160, sha256 and sha512 because they accept buffers as inputs. We can't use to-consensus-buff? directly without a workaround like this.
hash160
sha256
sha512
to-consensus-buff?
(let ((s "hello, world")) (slice? (try! (to-consensus-buff? s)) u5 (+ u5 (len s))))
Hashing functions should support strings as parameters. There should be a re-usable function, may be to-buff?, that contains above logic.
to-buff?
It's not convenient to use hashing functions like
hash160
,sha256
andsha512
because they accept buffers as inputs. We can't useto-consensus-buff?
directly without a workaround like this.Hashing functions should support strings as parameters. There should be a re-usable function, may be
to-buff?
, that contains above logic.