From f27a91a7b67790272578692ea20e2d875dbb3d35 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 23 Feb 2022 05:30:53 -0400 Subject: ADDED Can pass config parameters to compiler and select code based on it. Can also select code based on compiler version. --- stdlib/source/program/aedifex/hash.lux | 44 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 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 093f5fbe4..30b0cdcee 100644 --- a/stdlib/source/program/aedifex/hash.lux +++ b/stdlib/source/program/aedifex/hash.lux @@ -1,25 +1,25 @@ (.using - [library - [lux "*" - ["[0]" ffi {"+" import:}] - [abstract - [codec {"+" Codec}] - [equivalence {"+" Equivalence}] - [monad {"+" do}]] - [control - ["[0]" try {"+" Try}] - ["[0]" exception {"+" exception:}]] - [data - ["[0]" binary {"+" Binary}] - ["[0]" text - ["%" format {"+" Format format}] - ["[0]" encoding]]] - [math - [number - ["n" nat] - ["[0]" i64]]] - [type - abstract]]]) + [library + [lux "*" + ["[0]" ffi {"+" import:}] + [abstract + [codec {"+" Codec}] + [equivalence {"+" Equivalence}] + [monad {"+" do}]] + [control + ["[0]" try {"+" Try}] + ["[0]" exception {"+" exception:}]] + [data + ["[0]" binary {"+" Binary}] + ["[0]" text + ["%" format {"+" Format format}] + ["[0]" encoding]]] + [math + [number + ["n" nat] + ["[0]" i64]]] + [type + abstract]]]) ... TODO: Replace with pure-Lux implementations of these algorithms ... https://en.wikipedia.org/wiki/SHA-1#SHA-1_pseudocode @@ -44,7 +44,7 @@ (template [ ] [(def: .public ( value) (-> Binary (Hash )) - (|> (java/security/MessageDigest::getInstance []) + (|> (java/security/MessageDigest::getInstance [(ffi.as_string )]) (java/security/MessageDigest::digest [value]) :abstraction))] -- cgit v1.2.3