diff options
| author | Matias Goldfeld <[email protected]> | 2021-01-27 20:49:21 -0500 |
|---|---|---|
| committer | Matias Goldfeld <[email protected]> | 2021-01-27 20:49:21 -0500 |
| commit | 8ddf570a42d9baad61386c1238c07765d271f30e (patch) | |
| tree | a8d1751e035bedfea9edb1e1b838e4a6f381a140 /lib/models/snowflake.ml | |
| parent | Added message_reference functionality (diff) | |
| download | disml-8ddf570a42d9baad61386c1238c07765d271f30e.tar.xz disml-8ddf570a42d9baad61386c1238c07765d271f30e.zip | |
Fixed snowflake for 32 bit machines
Diffstat (limited to 'lib/models/snowflake.ml')
| -rw-r--r-- | lib/models/snowflake.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/models/snowflake.ml b/lib/models/snowflake.ml index 2bf2281..f228bd7 100644 --- a/lib/models/snowflake.ml +++ b/lib/models/snowflake.ml @@ -10,10 +10,10 @@ let of_yojson d = let to_yojson s : Yojson.Safe.t = `String (Int.to_string s)
-let timestamp snowflake = (snowflake lsr 22) + 1_420_070_400_000
+let timestamp snowflake = Int64.(+) (Int64.of_int (snowflake lsr 22)) 1_420_070_400_000L
let time_of_t snowflake =
- let t = timestamp snowflake |> float_of_int in
+ let t = timestamp snowflake |> Int64.to_float in
Time.(Span.of_ms t
|> of_span_since_epoch)
|