{"id":26700569,"url":"https://github.com/sionpixley/delirium","last_synced_at":"2026-01-03T22:30:27.888Z","repository":{"id":262193535,"uuid":"886368282","full_name":"sionpixley/delirium","owner":"sionpixley","description":"Delirium is a CLI tool and Go library that produces random values. Supports cryptographically-secure random values.","archived":false,"fork":false,"pushed_at":"2025-03-01T04:50:47.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T05:25:11.584Z","etag":null,"topics":["base64","cli","cli-tool","cryptographically-secure","cryptographically-secure-random","go","hexadecimal","random","random-number-generator","random-number-generators","random-string","random-string-generator","random-string-generators","shell","terminal"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sionpixley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-10T20:28:19.000Z","updated_at":"2025-03-01T04:48:44.000Z","dependencies_parsed_at":"2024-11-11T05:29:00.829Z","dependency_job_id":"1f37ae2e-c132-4dd4-b5a6-f7abe43c473d","html_url":"https://github.com/sionpixley/delirium","commit_stats":null,"previous_names":["sionpixley/delirium"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sionpixley%2Fdelirium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sionpixley%2Fdelirium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sionpixley%2Fdelirium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sionpixley%2Fdelirium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sionpixley","download_url":"https://codeload.github.com/sionpixley/delirium/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245759343,"owners_count":20667702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["base64","cli","cli-tool","cryptographically-secure","cryptographically-secure-random","go","hexadecimal","random","random-number-generator","random-number-generators","random-string","random-string-generator","random-string-generators","shell","terminal"],"created_at":"2025-03-27T00:28:28.698Z","updated_at":"2025-10-27T19:13:59.849Z","avatar_url":"https://github.com/sionpixley.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Delirium\n\nDelirium is a Go library and CLI tool that produces random values. Supports cryptographically-secure random values. \n\n## Table of contents\n\n1. [How to install the CLI](#how-to-install-delirium-cli-tool)\n2. [How to use the CLI](#how-to-use-delirium-cli)\n    1. [Printing help and usage information](#printing-help-and-usage-information)\n    2. [Making random base64 strings](#making-random-base64-strings)\n    3. [Making random URL-safe base64 strings](#making-random-url-safe-base64-strings)\n    4. [Making random hexadecimal strings](#making-random-hexadecimal-strings)\n3. [How to install the library](#how-to-install-delirium-library)\n4. [How to use the library](#how-to-use-delirium-library)\n    1. [securerand](#securerand)\n        1. [Making random bytes](#making-random-bytes)\n        2. [Making random base64 strings](#making-random-base64-strings-1)\n        3. [Making random URL-safe base64 strings](#making-random-url-safe-base64-strings-1)\n        4. [Making random hexadecimal strings](#making-random-hexadecimal-strings-1)\n    2. [pseudorand](#pseudorand)\n        1. [Making random bytes](#making-random-bytes-1)\n        2. [Making random base64 strings](#making-random-base64-strings-2)\n        3. [Making random URL-safe base64 strings](#making-random-url-safe-base64-strings-2)\n        4. [Making random hexadecimal strings](#making-random-hexadecimal-strings-2)\n5. [Building from source](#building-from-source)\n    1. [Building directly](#building-directly)\n        1. [Required technologies](#required-technologies)\n        2. [Building on Unix-like systems](#building-on-unix-like-systems)\n        3. [Building on Windows](#building-on-windows)\n    2. [Dockerfile](#dockerfile)\n        1. [Required technologies](#required-technologies-1)\n        2. [Building an image](#building-an-image)\n6. [Contributing](#contributing)\n\n## How to install Delirium CLI tool\n\nI currently do not provide any prebuilt binaries for this tool. In order to install the CLI, you will need to install Go first and then run this command after Go has been installed:\n\n`go install github.com/sionpixley/delirium/cmd/delirium@latest`\n\nMake sure the GOPATH bin directory is in your PATH environment variable or the `delirium` command won't be found.\n\n## How to use Delirium CLI\n\nThe `delirium` command does not require sudo/admin to use.\n\n### Printing help and usage information\n\n`delirium -h`\n\n### Making random base64 strings\n\nBy default, the `delirium` command will produce non-cryptographically-secure base64 strings with 16 bytes. If these defaults are ok with you, then run:\n\n`delirium`\n\nTo change the number of bytes to use in the algorithm, specify the number of bytes with the `-B` flag:\n\n`delirium -B 20`\n\nTo change the algorithm to be cryptographically-secure, add the `-secure` flag:\n\n`delirium -B 20 -secure`\n\n### Making random URL-safe base64 strings\n\nTo change the encoding to use base64's URL-safe encoding, specify the `-encoding` flag with the value `base64url`:\n\n`delirium -encoding=base64url`\n\nRegardless of the encoding used, you can still specify the number of bytes to use and whether to make the algorithm cryptographically-secure:\n\n`delirium -encoding=base64url -B 20 -secure`\n\n### Making random hexadecimal strings\n\nTo change the encoding to use hexadecimal, specify the `-encoding` flag with the value `hex`:\n\n`delirium -encoding=hex`\n\nRegardless of the encoding used, you can still specify the number of bytes to use and whether to make the algorithm cryptographically-secure:\n\n`delirium -encoding=hex -B 20 -secure`\n\n### Printing your current version of Delirium\n\n`delirium -v`\n\n## How to install Delirium library\n\n`go get github.com/sionpixley/delirium`\n\n## How to use Delirium library\n\nDelirium is a Go module that comes with two packages: `securerand` and `pseudorand`. The `securerand` package is a wrapper around the Go standard library [crypto/rand](https://pkg.go.dev/crypto/rand) and produces cryptographically-secure random values. The `pseudorand` package is a wrapper around the Go standard library [math/rand/v2](https://pkg.go.dev/math/rand/v2) and produces random values that are not cryptographically-secure.\n\n### securerand\n\nMake sure to include the import:\n\n`import \"github.com/sionpixley/delirium/pkg/securerand\"`\n\n#### Making random bytes\n\n`secureRandomBytes, err := securerand.Bytes(\u003cinsert-num-of-bytes\u003e)`\n\n#### Making random base64 strings\n\n`secureRandomBase64, err := securerand.Base64String(\u003cinsert-num-of-bytes\u003e, false)`\n\n#### Making random URL-safe base64 strings\n\n`secureRandomBase64, err := securerand.Base64String(\u003cinsert-num-of-bytes\u003e, true)`\n\n#### Making random hexadecimal strings\n\n`secureRandomHex, err := securerand.HexString(\u003cinsert-num-of-bytes\u003e)`\n\n### pseudorand\n\nMake sure to include the import:\n\n`import \"github.com/sionpixley/delirium/pkg/pseudorand\"`\n\n#### Making random bytes\n\n`randomBytes := pseudorand.Bytes(\u003cinsert-num-of-bytes\u003e)`\n\n#### Making random base64 strings\n\n`randomBase64 := pseudorand.Base64String(\u003cinsert-num-of-bytes\u003e, false)`\n\n#### Making random URL-safe base64 strings\n\n`randomBase64 := pseudorand.Base64String(\u003cinsert-num-of-bytes\u003e, true)`\n\n#### Making random hexadecimal strings\n\n`randomHex := pseudorand.HexString(\u003cinsert-num-of-bytes\u003e)`\n\n## Building from source\n\nThere are two main ways to build Delirium from source: [Building with Go directly](#building-directly) or [building the Dockerfile](#dockerfile).\n\nBuilding with the Dockerfile is good for quick local testing.\n\n### Building directly\n\n#### Required technologies\n\n- Go 1.22 or newer\n\n#### Building on Unix-like systems\n\n`go build -o delirium ./cmd/delirium`\n\n#### Building on Windows\n\n`go build -o delirium.exe ./cmd/delirium`\n\n### Dockerfile\n\n#### Required technologies\n\n- Docker\n\n#### Building an image\n\n`docker build -t delirium .`\n\n## Contributing\n\nAll contributions are welcome! If you wish to contribute to the project, the best way would be forking this repo and making a pull request from your fork with all of your suggested changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsionpixley%2Fdelirium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsionpixley%2Fdelirium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsionpixley%2Fdelirium/lists"}