mirror of
https://github.com/urbit/shrub.git
synced 2024-12-04 14:58:10 +03:00
Get at the length field of sha-512
This lets us take the hash of old-world strings with a bunch of trailing zero bytes.
This commit is contained in:
parent
1af62de359
commit
6aa1ca3c73
@ -3519,11 +3519,14 @@
|
||||
[[256 d] $(c d, b (sub b 256))]
|
||||
--
|
||||
++ shaz :: sha-512
|
||||
~/ %shaz
|
||||
|= ruz=@ ^- @
|
||||
(shal [(met 3 ruz) ruz])
|
||||
++ shal :: sha-512 with length
|
||||
~/ %shal
|
||||
|= [len=@ ruz=@] ^- @
|
||||
=+ [few==>(fe .(a 6)) wac=|=([a=@ b=@] (cut 6 [a 1] b))]
|
||||
=+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
|
||||
=+ ral=(lsh 0 3 (met 3 ruz))
|
||||
=+ ral=(lsh 0 3 len)
|
||||
=+ ^= ful
|
||||
%+ can 0
|
||||
:~ [ral ruz]
|
||||
|
Loading…
Reference in New Issue
Block a user