Skip to content

Commit

Permalink
add more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dropwhile committed Oct 26, 2024
1 parent 24b2e7e commit be9653b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/gbase32_clockwork/gbase32.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ pub type DecodeFn =

/// Create a new encoder that can be be reused to encode strings in base32 clockwork
///
/// ## Examples
///
/// ```gleam
/// let encode = new_encoder()
/// encode("foobar")
/// // -> Ok("csqpyrk1e8")
/// ```
///
pub fn new_encoder() -> EncodeFn {
let encodebook: EncodeBook =
clockwork_codebook
Expand All @@ -34,6 +42,14 @@ pub fn new_encoder() -> EncodeFn {

/// Create a new decoder that can be be reused to decode strings from base32 clockwork
///
/// ## Examples
///
/// ```gleam
/// let decode = new_decoder()
/// decode("CSQPYRK1E8")
/// // -> Ok("foobar")
/// ```
///
pub fn new_decoder() -> DecodeFn {
let decodebook: DecodeBook =
clockwork_codebook
Expand Down

0 comments on commit be9653b

Please sign in to comment.