From 9af3c7ace588b8ab1504294ebf2e7e6f188b9d4b Mon Sep 17 00:00:00 2001 From: nelsonic Date: Sat, 25 Apr 2020 23:27:44 +0100 Subject: [PATCH] update docs in README.md with example usage for Base58.decode/1 #13 --- README.md | 11 ++++++----- lib/base58.ex | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f1f50d8..2f27d43 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,11 @@ [![Inline docs](http://inch-ci.org/github/dwyl/base58.svg?branch=master&style=flat-square)](http://inch-ci.org/github/dwyl/base58) --> -`b58` provides functions `encode/1` and `decode/1`
+`Base58` provides two functions to +work with Base58 encoded strings: `Base58.encode/1` and `Base58.decode/1`
`encode/1` takes an **Elixir binary** (_String, Number, etc._) and returns a Base58 encoded String.
-`encode/1` receives a Base58 encoded String and returns a binary. +`decode/1` receives a Base58 encoded String and returns a binary. See the section [What is an Elixir binary?](#what-is-an-elixir-binary) for more information about the binary type in Elixir. @@ -26,7 +27,7 @@ See the section [What is an Elixir binary?](#what-is-an-elixir-binary) for more ``` defp deps do - [b58: "~> 1.0.0"] + [Base58: "~> 1.0.0"] end ``` @@ -35,14 +36,14 @@ and run `mix deps.get` 2. Invoke the `encode` function with a binary as parameter: ``` - B58.encode("foo") + Base58.encode("foo") "bQbp" ``` 3. Invoke the `decode` function with a `base58` encoded string: ``` -B58.encode("hello") |> B58.decode() +Base58.encode("hello") |> Base58.decode() "hello" ``` diff --git a/lib/base58.ex b/lib/base58.ex index d9e2ae5..966a361 100644 --- a/lib/base58.ex +++ b/lib/base58.ex @@ -1,6 +1,6 @@ defmodule Base58 do @moduledoc """ - `base58` provides two functions: `encode/1` and `decode/1`. + `Base58` provides two functions: `encode/1` and `decode/1`. `encode/1` takes an **Elixir binary** (_String, Number, etc._) and returns a Base58 encoded String. `decode/1` receives a Base58 encoded String and returns a binary.