Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ju0x/humanhash
human-readable representations of digests
https://github.com/ju0x/humanhash
accessibility checksum digest go golang golang-module google hacktoberfest hash hashing support username verify
Last synced: 8 days ago
JSON representation
human-readable representations of digests
- Host: GitHub
- URL: https://github.com/ju0x/humanhash
- Owner: Ju0x
- License: mit
- Created: 2023-10-08T14:31:05.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-31T15:51:59.000Z (about 1 year ago)
- Last Synced: 2024-08-21T09:58:49.443Z (3 months ago)
- Topics: accessibility, checksum, digest, go, golang, golang-module, google, hacktoberfest, hash, hashing, support, username, verify
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HumanHash
Human-readable digests in Go
Based on: https://github.com/zacharyvoase/humanhash
⚠️ **Warning:** These should only be used to representate another digest or UUID in a more readable version. They're not safe to use as a real hashing algorithm because they don't provide any safety features from modern hashes.
## Example
Generate a Humanhash based on a SHA256 digest:
```go
// Generate SHA256 hash
s := "Example"h := sha256.New()
h.Write([]byte(s))
digest := h.Sum(nil)// Generate Humanhash
hash, _ := humanhash.Humanize(digest, 4, "-")// Output:
// jig-table-kansas-lion
fmt.Println(hash)
```Generate a UUID with a Humanhash:
```go
hash, uuid, _ := humanhash.UUID()// Output:
// Humanhash: sixteen-maryland-island-jig UUID: 361fbc5c-8154-4b1b-983f-d313934b3d8f
fmt.Printf("Humanhash: %s UUID: %s\n", hash, uuid)
```Set a custom Wordlist (must have 256 words)
```go
humanhash.Wordlist("custom_wordlist.txt")
```