Before the release of [elm/bytes], many packages would use List Int
to represent bytes. To enable interaction with these packages, you can use
fromByteValues and toByteValues.
Convert Bytes to List Int. Each Int represents a single byte,
so values will be between 0 and 255 inclusive.
import SHA1
SHA1.fromString "And the band begins to play"
|> SHA1.toBytes
|> toByteValues
--> [ 0xF3, 0x08, 0x73, 0x13
--> , 0xD6, 0xBC, 0xE5, 0x5B
--> , 0x60, 0x0C, 0x69, 0x2F
--> , 0xE0, 0x92, 0xF4, 0x53
--> , 0x87, 0x3F, 0xAE, 0x91
--> ]
Convert a
List InttoBytes. EachIntrepresents a single byte, so values are assumed to be between 0 and 255 inclusive.