View Source Telehashname (Telehashname v1.0.2)
Telehash hashname handling
https://github.com/telehash/telehash.org/blob/master/v3/hashname.md
Summary
Functions
Find the highest rated match among two CSK lists
Generate a hashname from a list of CSKs
Generate a hashname from intermediates
Validate and sort a CSID list
Determine if something looks like a valid hashname
Determine if something looks like a valid CSID
Types
@type csid() :: binary()
Cipher Set ID
As an affordance, many functions will take a 4-byte CSID (the CSID with a pre-pended cs
.)
These will be normalized in most return values. It is not recommended to depend upon this
behavior.
A list of CSIDs
A list of CSKs
Maps will generally be transformed to a list of CSK tuples in the return values.
Cipher Set Key
@type sort_dir() :: :asc | :dsc
Sort direction control
- :asc == ascending
- :dsc == descending
Functions
Find the highest rated match among two CSK lists
The values returned from the outs
list. Selecting
which list to use for check
and outs
may provide
some useful information "for free."
Generate a hashname from a list of CSKs
As an affordance, an intermediates map may also be provided.
The return value is a tuple with the hashname and a map of the intermediate values used for generation.
nil
is returned when no valid CSKs are found in the list.
Generate a hashname from intermediates
Validate and sort a CSID list
This can handle multiple forms of provided CSIDs. The return value will be appropriate to the input parameter.
Invalid CSIDs are removed, remaining IDs are normalized and sorted in the requested order.
Determine if something looks like a valid hashname
Confirms form only, not validity
Determine if something looks like a valid CSID
Confirms form only, not validity. Some functions be more liberal in what they accept, but confirming validity is always better.