Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

krepflap/ex_tripcode

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExTripcode

Elixir library for generating tripcodes.

From the full wiki:

A tripcode is a means of telecommunication authentication that does not require registration. Tripcodes are most often used in 2channel-style message boards or Futaba Channel-style imageboards. A tripcode is a hashed password by which a person can be identified by others.

Note: There exist widely different implementations of tripcodes, this one is based on https://github.com/justinjensen/tripcode/

Installation

The package can be installed by adding ex_tripcode to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_tripcode, "~> 1.0"},
  ]
end

Docs

https://hexdocs.pm/ex_tripcode/ExTripcode.html

Usage

Generating Tripcodes

Most simple usage:

iex> ExTripcode.hash("elixir")
"H3R1pplX/."

Secure Tripcodes work too, just pass in a secret seed:

iex> ExTripcode.hash("elixir", "secret")
"KZ1B7o9AtcJD9XQ"

Parsing user strings

You can also parse a user string straight away. Note that if you don't pass a seed, it will only parse for regular tripcodes, not secure tripcodes.

iex> seed = "secret"
iex> ExTripcode.parse("User#elixir#elixir", seed)
%{user: "User", code: "H3R1pplX/.", secure: "KZ1B7o9AtcJD9XQ"}

iex> ExTripcode.parse("User##elixir", seed)
%{user: "User", secure: "KZ1B7o9AtcJD9XQ"}

iex> ExTripcode.parse("User#elixir", seed)
%{user: "User", code: "H3R1pplX/."}

iex> ExTripcode.parse("User#elixir")
%{user: "User", code: "H3R1pplX/."}

Links

License

MIT.

About

Elixir library for generating tripcodes.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.