https://github.com/quelgar/roc-utils
Miscellaneous utility functions for the Roc language
https://github.com/quelgar/roc-utils
roc-lang
Last synced: 3 months ago
JSON representation
Miscellaneous utility functions for the Roc language
- Host: GitHub
- URL: https://github.com/quelgar/roc-utils
- Owner: quelgar
- License: upl-1.0
- Created: 2024-05-18T04:50:02.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-09T00:27:03.000Z (4 months ago)
- Last Synced: 2025-02-15T08:43:02.800Z (3 months ago)
- Topics: roc-lang
- Language: Roc
- Homepage:
- Size: 16.6 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- roc-awesome - quelgar/roc-utils
README
# roc-utils
Miscellaneous utility functions for the Roc language. I wrote these as an exercise to learn the language. They're not optimized in any way, but as far as I can tell they work correctly.
* `Hex` — convert between bytes and hex strings
* `Base64` — encode and decode base64 strings
* `Sha` — compute SHA 256 hashes
* `Hmac` — HMAC-SHA 256 message authentication## How to use
Look for the latest release and copy the URL of the `.tar.br` file, then use it in your Roc application like this:
```roc
app [main!] {
cli: platform "",
utils: "",
}import utils.Base64
encoded = Str.toUtf8 |> Base64.encode
```