aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/program')
-rw-r--r--stdlib/source/program/aedifex/dependency.lux4
-rw-r--r--stdlib/source/program/aedifex/hash.lux27
-rw-r--r--stdlib/source/program/compositor.lux1
3 files changed, 30 insertions, 2 deletions
diff --git a/stdlib/source/program/aedifex/dependency.lux b/stdlib/source/program/aedifex/dependency.lux
index 13e30028b..473d5498e 100644
--- a/stdlib/source/program/aedifex/dependency.lux
+++ b/stdlib/source/program/aedifex/dependency.lux
@@ -1,5 +1,7 @@
(.module:
- [lux (#- Type)])
+ [lux (#- Type)]
+ ["." // #_
+ ["#." hash]])
## https://maven.apache.org/ref/3.6.3/maven-core/artifact-handlers.html
(type: #export Type
diff --git a/stdlib/source/program/aedifex/hash.lux b/stdlib/source/program/aedifex/hash.lux
new file mode 100644
index 000000000..bd4396006
--- /dev/null
+++ b/stdlib/source/program/aedifex/hash.lux
@@ -0,0 +1,27 @@
+(.module:
+ [lux #*
+ ["." host (#+ import:)]
+ [data
+ ["." binary (#+ Binary)]]])
+
+## TODO: Replace with pure-Lux implementations of these algorithms
+## https://en.wikipedia.org/wiki/SHA-1#SHA-1_pseudocode
+## https://en.wikipedia.org/wiki/MD5#Algorithm
+(import: #long java/lang/String)
+
+(import: #long java/security/MessageDigest
+ (#static getInstance [java/lang/String] java/security/MessageDigest)
+ (digest [[byte]] [byte]))
+
+(type: #export Hash
+ Binary)
+
+(template [<name> <algorithm>]
+ [(def: #export (<name> value)
+ (-> Binary Hash)
+ (|> (java/security/MessageDigest::getInstance [<algorithm>])
+ (java/security/MessageDigest::digest [value])))]
+
+ [sha1 "SHA-1"]
+ [md5 "MD5"]
+ )
diff --git a/stdlib/source/program/compositor.lux b/stdlib/source/program/compositor.lux
index d551f61f2..1b17a4de8 100644
--- a/stdlib/source/program/compositor.lux
+++ b/stdlib/source/program/compositor.lux
@@ -149,7 +149,6 @@
(<| (or-crash! "Export failed:")
(do (try.with promise.monad)
[_ (/export.export (get@ #platform.&file-system platform)
- (get@ #/static.host-module-extension static)
export)]
(wrap (log! "Export complete!"))))