defmodule Hexzip.Z do @moduledoc false alias Krug.StringUtil def x(z,y,w) do z(z,y,w,[]) end defp d(x,y) do x * y end defp z(w,x,y,z) do cond do (w > x) -> z |> x() true -> w |> d() |> z(x,y,x(z,w(w,y))) end end defp w(y,w) do z = y |> w() |> y(w) |> y() [d() |> z(z),c() |> z(z),d() |> d() |> d() |> z(z),d() |> d() |> z(z)] |> z() end defp y(y) do y |> String.graphemes() end defp y(u,y) do u |> StringUtil.left_zeros(y) end defp w(w) do d = d() |> d() |> d() w |> Integer.to_string(d |> d(d |> d() |> d()) |> d()) end defp x(z,x) do [x | z] end defp d() do 1 + c() end defp z(a,z) do z |> Enum.at(a) end defp z(z) do z |> IO.iodata_to_binary() end defp x(x) do x |> Enum.reverse() end defp c() do 0 end defp d(r) do 1 + r end end