aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/hash.lux
diff options
context:
space:
mode:
authorEduardo Julian2022-02-23 05:30:53 -0400
committerEduardo Julian2022-02-23 05:30:53 -0400
commitf27a91a7b67790272578692ea20e2d875dbb3d35 (patch)
treecf0d9a53f3ef1b16be92ee5a120651b1abbb866d /stdlib/source/program/aedifex/hash.lux
parentf07effd9faf3fdaa677f659d6bbccf98931c5e5a (diff)
ADDED Can pass config parameters to compiler and select code based on it. Can also select code based on compiler version.
Diffstat (limited to 'stdlib/source/program/aedifex/hash.lux')
-rw-r--r--stdlib/source/program/aedifex/hash.lux44
1 files changed, 22 insertions, 22 deletions
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 [<name> <kind> <algorithm>]
[(def: .public (<name> value)
(-> Binary (Hash <kind>))
- (|> (java/security/MessageDigest::getInstance [<algorithm>])
+ (|> (java/security/MessageDigest::getInstance [(ffi.as_string <algorithm>)])
(java/security/MessageDigest::digest [value])
:abstraction))]