Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Godspower-Eze committed Dec 12, 2023
1 parent 3f6b070 commit f683b0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ssz_ex.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ defmodule LambdaEthereumConsensus.SszEx do
### Public API
#################

@bits_per_chunk 256

@spec hash(iodata()) :: binary()
def hash(data), do: :crypto.hash(:sha256, data)

Expand Down Expand Up @@ -406,7 +408,7 @@ defmodule LambdaEthereumConsensus.SszEx do
end

defp pack(value, size) when is_integer(value) and value >= 0 do
pad = 256 - size
pad = @bits_per_chunk - size
<<value::size(size)-little, 0::size(pad)>>
end

Expand Down

0 comments on commit f683b0c

Please sign in to comment.