[MLton-commit] r6091
Vesa Karvonen
vesak at mlton.org
Fri Oct 26 02:00:15 PDT 2007
Port to MLKit.
----------------------------------------------------------------------
A mltonlib/trunk/com/ssh/random/unstable/detail/ml/mlkit/
A mltonlib/trunk/com/ssh/random/unstable/detail/ml/mlkit/random-dev.mlb
A mltonlib/trunk/com/ssh/random/unstable/detail/ml/mlkit/random-dev.sml
----------------------------------------------------------------------
Copied: mltonlib/trunk/com/ssh/random/unstable/detail/ml/mlkit/random-dev.mlb (from rev 6080, mltonlib/trunk/com/ssh/random/unstable/detail/ml/mlton/random-dev.mlb)
===================================================================
--- mltonlib/trunk/com/ssh/random/unstable/detail/ml/mlton/random-dev.mlb 2007-10-24 12:29:43 UTC (rev 6080)
+++ mltonlib/trunk/com/ssh/random/unstable/detail/ml/mlkit/random-dev.mlb 2007-10-26 09:00:08 UTC (rev 6091)
@@ -0,0 +1,18 @@
+(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+local
+ $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb
+in
+ ann
+ "forceUsed"
+ "sequenceNonUnit warn"
+ "warnUnused true"
+ in
+ ../../../public/random-dev.sig
+ random-dev.sml
+ end
+end
Copied: mltonlib/trunk/com/ssh/random/unstable/detail/ml/mlkit/random-dev.sml (from rev 6080, mltonlib/trunk/com/ssh/random/unstable/detail/ml/smlnj/random-dev.sml)
===================================================================
--- mltonlib/trunk/com/ssh/random/unstable/detail/ml/smlnj/random-dev.sml 2007-10-24 12:29:43 UTC (rev 6080)
+++ mltonlib/trunk/com/ssh/random/unstable/detail/ml/mlkit/random-dev.sml 2007-10-26 09:00:08 UTC (rev 6091)
@@ -0,0 +1,18 @@
+(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+structure RandomDev : RANDOM_DEV = struct
+ (* XXX implement better seed/useed for MLKit *)
+ val cnt = ref 0w0
+ fun seed () =
+ SOME (Word.xorb
+ (Word.fromLargeInt
+ (Time.toMicroseconds (Time.now ()) mod
+ Word.toLargeInt Word.maxValue),
+ !cnt)
+ before cnt := !cnt + 0w1)
+ val useed = seed
+end
More information about the MLton-commit
mailing list