View Source BitcoinLib.Crypto.Convert (BitcoinLib v0.4.7)

Cryptography helper functions

Link to this section Summary

Functions

Converts an integer, most probably a private key, into a 0 padded binary of a fix length

Link to this section Functions

Link to this function

integer_to_binary(value, bytes_length \\ 32)

View Source
@spec integer_to_binary(integer(), integer()) :: String.t()

Converts an integer, most probably a private key, into a 0 padded binary of a fix length

examples

Examples

iex> 0x0A8D286B11B98F6CB2585B627FF44D12059560ACD430DCFA1260EF2BD9569373
...> |> BitcoinLib.Crypto.Convert.integer_to_binary()
<< 10, 141, 40, 107, 17, 185, 143, 108, 178, 88,
   91, 98, 127, 244, 77, 18, 5, 149, 96, 172, 212,
   48, 220, 250, 18, 96, 239, 43, 217, 86, 147, 115>>