https://github.com/krepflap/ex_tripcode
Elixir library for generating tripcodes.
https://github.com/krepflap/ex_tripcode
elixir textboards tripcodes
Last synced: 8 months ago
JSON representation
Elixir library for generating tripcodes.
- Host: GitHub
- URL: https://github.com/krepflap/ex_tripcode
- Owner: krepflap
- License: mit
- Created: 2019-06-16T10:49:33.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-16T08:12:06.000Z (almost 7 years ago)
- Last Synced: 2025-10-21T15:48:57.307Z (8 months ago)
- Topics: elixir, textboards, tripcodes
- Language: Elixir
- Homepage: https://hex.pm/packages/ex_tripcode
- Size: 32.2 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ExTripcode
Elixir library for generating tripcodes.
From [the full wiki](http://www.thefullwiki.org/Tripcode):
>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`:
```elixir
def deps do
[
{:ex_tripcode, "~> 1.0"},
]
end
```
## Docs
https://hexdocs.pm/ex_tripcode/ExTripcode.html
## Usage
### Generating Tripcodes
Most simple usage:
```elixir
iex> ExTripcode.hash("elixir")
"H3R1pplX/."
```
Secure Tripcodes work too, just pass in a secret seed:
```elixir
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.
```elixir
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
* https://github.com/justinjensen/tripcode
* https://github.com/Nepeta/tripcode
* http://www.thefullwiki.org/Tripcode
* https://www.4chan.org/faq#trip
## License
MIT.