Skip to content

iilei/proquint

Repository files navigation

Proquint

codecov

Proquint generates and decodes human-recognisable identifiers: short five-letter words ("proquints") that represent arbitrary-size integers.

Details at the Proposal for Proquints.

Why use proquints?

  • They are easier to read, say, and remember than long numeric or hex strings.
  • They provide a compact, hyphen-separated representation for big integers.

For humans, the difference between gipur-saluf and lukab-kodun is generally easier to perceive than the difference between 36bbc1f2 and 7d806879.

Install

Build from source:

go build ./cmd/proquint

Install the CLI (recommended):

go install github.com/iilei/proquint/cmd/proquint@latest

Homebrew via tap:

brew install iilei/tap/proquint

Run the test suite:

go test ./...

Usage

Basic CLI usage:

  • Encode a decimal or 0x-prefixed hex bigint to a proquint:
proquint encode <number>
  • Decode a proquint back to a decimal bigint:
proquint decode <proquint>
  • --pad-groups=N (encode): left-pad the output with N groups of babab (zero) so the result has at least N groups.

Examples (these match the test-suite expectations):

  • proquint encode 42 -> babop
  • proquint encode --pad-groups=2 42 -> babab-babop
  • proquint decode babop -> 42
  • Large values are supported; the tests verify 256-bit max values round-trip.

Encode a SHA 256

proquint accepts 0x-prefixed hexadecimal numbers. Here is an example of how to encode a File SHA256 checksum:

SHA=$(sha256sum LICENSE --tag | awk -F' ' '{print $NF}')
proquint encode 0x$SHA
# gipur-saluf-juvuf-gisid-mokar-mivub-lavil-hajah-rufup-pokah-miroh-bomik-doduj-silob-zopit-pohon

This illustrates a usage scenario for quick integrity checks. A small change such as echo '.' >> LICENSE is often easier to spot when comparing proquints than when comparing raw hexadecimal digests.

Encode an IP Adress

This functionality remains out-of-scope in favor of a more strict isolation of concerns.

Instead, IP-to-Decimal conversion needs to be done before invocing proquint encode. Implementation example:

IP="192.168.1.1"
proquint encode $(echo $IP | awk -F. '{print ($1 * 2^24) + ($2 * 2^16) + ($3 * 2^8) + $4}')
# safom-bahad

Development

To run the binary built locally:

./proquint encode 12345

Contributing

Contributions welcome — open an issue or submit a PR. Please include tests for new behavior.

License

This project is licensed under the terms in the LICENSE file.

About

Proquint generates and decodes human-recognisable identifiers: short five-letter words ("proquints") that represent arbitrary-size integers.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages