alphabetify v1.1.0 Alphabetify

Alphabetify

Alphabetify is a module that generates sequential alphabetic hashes.

Use

Before generating hashes, you should seed the module with your initial hash. By default, the module will begin at 'AAAA'. To use a different initial hash, call the seed_hash/1 function. Example: Alphabetify.seed_hash("AAAAAA").

Each time you want to get the next available hash, call generate_hash/0. Example: Alphabetify.generate_hash. That function will advance the hash and persist it, then return the new hash.

The hash will append new characters when required. Examples: 'ZZZZ' -> 'AAAAA' and 'AAAZ' -> 'AABA'

Link to this section Summary

Functions

This generates the next hash in the sequence.

This gets the last hash used.

Returns the table name used for the current environment

This sets the initial value in the hash sequence.

Link to this section Functions

Link to this function

generate_hash()

generate_hash() :: String.t()

This generates the next hash in the sequence.

Examples

iex> Alphabetify.seed_hash("AAAA")
iex> Alphabetify.generate_hash
"AAAB"
Link to this function

last_hash()

last_hash() :: String.t()

This gets the last hash used.

Examples

iex> Alphabetify.seed_hash("ABCD")
iex> Alphabetify.last_hash
"ABCD"
Link to this function

last_hash_table()

last_hash_table() :: atom()

Returns the table name used for the current environment

Examples

iex> Alphabetify.last_hash_table()
:alphabetify_disk_test_store
Link to this function

seed_hash(seed)

seed_hash(String.t()) :: String.t()

This sets the initial value in the hash sequence.

Examples

iex> Alphabetify.seed_hash("BBBB")
"BBBB"