Renamed to volgariver6/elm-int64. That is where the repository lives now. It has not been published as a package under the new name.
Versions published as lauber00/elm-int64 still install under that name. 7 versions of 7 come from the new location (see their notes).
Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/volgariver6/elm-int64.
What we checked: The repo moved to github.com/volgariver6/elm-int64. Rebuilt with git archive from commit 68b9b06f88df of https://github.com/volgariver6/elm-int64 (zip prefix lauber00-elm-int64-bcf390d/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 2ed766fda275550ac7c1361c84719be9d2bfcec0.
The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.
Details · package.elm-lang.org's zip: https://github.com/lauber00/elm-int64/zipball/1.2.0/
An efficient 64-bit integer with correct overflow.
Bitwise operators in javascript can only use 32 bits. Sometimes, external protocols use 64-bit integers. This package implementes such integers with "correct" overflow behavior.
This is a low-level package focussed on speed. The 64-bit integers are represented as a 2-tuple of 32-bit numbers. There are helpers for conversion to string and elm/bytes Bytes.
import Int64
Int64.add (Int64.fromInt 42) (Int64.fromInt 10)
|> Int64.toUnsignedString
--> "52"
Int64.subtract (Int64.fromInt 10) (Int64.fromInt 42)
|> Int64.toSignedString
--> "-32"
Int64.xor
(Int64.fromInt32s 0xDEADBEEF 0xBAAAAAAD)
(Int64.fromInt 42)
|> Int64.toHex
--> "deadbeefbaaaaa87"Performance is roughly half for subtraction, addition and the bitwise operators. That is great considering int64 is really two 32-bit integers, so we're doing operations twice.
This package is extensively tested with fuzz tests. Nonetheless, the logic is extremely tricky, so there might still be bugs.
Int64 -> Int
This is unsafe, because Int cannot store all the information of a Int64. If you think the conversion is safe for you, use:
Int64.fromInt 42
|> Int64.toSignedString
|> String.toInt
--> Just 42String -> Int64
And by extension converting 64-bit integers in e.g. JSON into Int64. This is tricky to implement, but PRs are welcome!
Multiplication, integer division, modulo
Would be nice to have, again PRs are welcome!