From ec1f31b5a1492d5e0ab260397291d4449483bbd9 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 23 Aug 2021 02:30:53 -0400 Subject: The Python compiler can now be compiled by the new JVM compiler. --- stdlib/source/program/aedifex/hash.lux | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'stdlib/source/program/aedifex/hash.lux') diff --git a/stdlib/source/program/aedifex/hash.lux b/stdlib/source/program/aedifex/hash.lux index 92414c441..74e78ca55 100644 --- a/stdlib/source/program/aedifex/hash.lux +++ b/stdlib/source/program/aedifex/hash.lux @@ -54,10 +54,10 @@ [md5 ..MD5 "MD5"] ) - (def: encode + (def: encoded (Format Binary) (binary.aggregate (function (_ byte representation) - (let [hex (\ n.hex encode byte) + (let [hex (\ n.hex encoded byte) hex (case (text.size hex) 1 (format "0" hex) _ hex)] @@ -88,7 +88,7 @@ (template [ ] [(exception: .public ( {data Binary}) (exception.report - ["Pseudo hash" (%.text (..encode data))] + ["Pseudo hash" (%.text (..encoded data))] ["Expected size" (%.nat )] ["Actual size" (%.nat (binary.size data))]))] @@ -115,7 +115,7 @@ (-> Nat Nat) (n.* ..hex_per_byte)) - (def: (decode size constructor encoded) + (def: (decoded size constructor encoded) (All [h] (-> Nat (-> Binary (Try (Hash h))) (-> Text (Try (Hash h))))) @@ -128,7 +128,7 @@ (case (text.split_at ..hex_per_chunk input) (#.Some [head tail]) (do try.monad - [head (\ n.hex decode head) + [head (\ n.hex decoded head) output (binary.write/64! index head output)] (recur tail (++ chunk) output)) @@ -138,7 +138,7 @@ (^template [ ] [ (do try.monad - [head (\ n.hex decode input) + [head (\ n.hex decoded input) output ( index head output)] (constructor output))]) ([1 binary.write/8!] @@ -151,8 +151,8 @@ [(implementation: .public (Codec Text (Hash )) - (def: encode (|>> :representation ..encode)) - (def: decode (..decode )))] + (def: encoded (|>> :representation ..encoded)) + (def: decoded (..decoded )))] [sha-1_codec SHA-1 ..sha-1::size ..as_sha-1] [md5_codec MD5 ..md5::size ..as_md5] -- cgit v1.2.3