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.
Convert a Int to Int64. This is guaranteed to work for integers in the safe JS range.
fromInt 42
|> toSignedString
--> "42"Give two integers, corresponding to the upper and lower 32 bits
fromInt32s 4 2
|> toHex
--> "0000000400000002"64-bit addition, with correct overflow
fromInt32s 0xFFFFFFFF 0xFFFFFFFF
|> Int64.add (Int64.fromInt 1)
|> Int64.toUnsignedString
--> "0"
fromInt32s 0xFFFFFFFF 0xFFFFFFFF
|> Int64.add (Int64.fromInt 2)
|> Int64.toUnsignedString
--> "1"64-bit subtraction, with correct overflow
-- equivalent to `0 - 1`
Int64.subtract (Int64.fromInt 0) (Int64.fromInt 1)
|> Int64.toUnsignedString
--> "18446744073709551615"
-- equivalent to `0 - 1`
Int64.subtract (Int64.fromInt 0) (Int64.fromInt 1)
|> Int64.toSignedString
--> "-1"
-- equivalent to `1 - 0`
Int64.subtract (Int64.fromInt 1) (Int64.fromInt 0)
|> Int64.toUnsignedString
--> "1"Bitwise and
Bitwise or
Bitwise xor
Bitwise complement
Left bitwise shift, typically written <<
Fills in zeros from the right.
Int64.fromInt32s 0xDEADBEAF 0xBAAAAAAD
|> Int64.shiftLeftBy 16
|> Int64.toHex
--> "beafbaaaaaad0000"Right bitwise shift, typically written >> (but >>> in JavaScript)
Fills in zeros from the left.
Int64.fromInt32s 0xDEADBEAF 0xBAAAAAAD
|> Int64.shiftRightZfBy 16
|> Int64.toHex
--> "0000deadbeafbaaa"Left bitwise rotation
Int64.fromInt32s 0xDEADBEAF 0xBAAAAAAD
|> Int64.rotateLeftBy 16
|> Int64.toHex
--> "beafbaaaaaaddead"Right bitwise rotation
Int64.fromInt32s 0xDEADBEAF 0xBAAAAAAD
|> Int64.rotateRightBy 16
|> Int64.toHex
--> "aaaddeadbeafbaaa"Compare two Int64 values, intepreting the bits as a signed integer.
Compare two Int64 values, intepreting the bits as an unsigned integer.
Interpret a Int64 as an unsigned integer, and give its string representation
toSignedString (fromInt 10)
--> "10"
toSignedString (fromInt -10)
--> "-10"Interpret a Int64 as an unsigned integer, and give its string representation
toUnsignedString (fromInt 10)
--> "10"
toUnsignedString (fromInt -10)
--> "18446744073709551606"Convert a Int64 to a hexadecimal string
toHex (fromInt (256 - 1))
--> "00000000000000ff"Bits as a string of 0s and 1s in big-endian order.
toBitString (fromInt 42)
--> "0000000000000000000000000000000000000000000000000000000000101010"A elm/bytes Decoder for Int64
A elm/bytes Encoder for Int64
Convert an Int64 to its 8 byte values in big-endian order
toByteValues (fromInt 0xDEADBEAF)
--> [0,0,0,0,222,173,190,175]The individual bits as a list of Bool in big-endian order.
toBits (fromInt 10)
--> [False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,True,False,True,False]Convert an Int64 with zigZag algorithm to its original Int64 value
fromZigZag (0, 20)
--> (0, 10)Convert an Int64 to a new Int64 with zigZag algorithm
toZigZag (0, 10)
--> (0, 20)Give an Int64 var, corresponding to Int var
toInt (0, 2)
--> 2
A 64-bit integer type with correct overflow behavior
Internally, the number is stored as two 32-bit integers.