Skip to content

Instantly share code, notes, and snippets.

@KamilLelonek
Last active April 3, 2018 10:55
Show Gist options
  • Save KamilLelonek/d35e08f7f0744722f8b495ff8540431a to your computer and use it in GitHub Desktop.
Save KamilLelonek/d35e08f7f0744722f8b495ff8540431a to your computer and use it in GitHub Desktop.
def call(input, acc) do
input
|> div(58)
|> call(extended_hash(input, acc))
end
defp extended_hash(input, acc) do
"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
|> String.at(rem(input, 58))
|> apend(acc)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment