Current section
Files
Jump to
Current section
Files
lib/google_sheets/utils.ex
defmodule GoogleSheets.Utils do
@moduledoc """
Helper functions used by other modules in this library.
"""
@doc """
Converts matching binary into a hex string.
"""
def hexstring(<<x::size(128)>>), do: to_string(hd(:io_lib.format("~32.16.0b", [x])))
def hexstring(<<x::size(160)>>), do: to_string(hd(:io_lib.format("~40.16.0b", [x])))
def hexstring(<<x::size(256)>>), do: to_string(hd(:io_lib.format("~64.16.0b", [x])))
def hexstring(<<x::size(512)>>), do: to_string(hd(:io_lib.format("~128.16.0b", [x])))
end