Elixir Binaries and Bit Strings
Today I learned that in Elixir Binary
is a sub type of Bit String
with all elements using a multiple of 8 bits.
"a" # => "a"
?a # => 97
<<97>> # => "a"
is_bitstring <<97>> # => true
is_binary <<97>> # => true
is_bitstring <<97::4>> # => true
is_binary <<97::4>> # => false
is_binary <<97::16>> # => true
-
So
String
is a UTF-8Binary
. -
And
Binary
is a multiple 8 bitsBit String
.