https://github.com/koki-develop/hebr
hebr is a command line tool or library for encoding/decoding data in Hebrew characters.
https://github.com/koki-develop/hebr
Last synced: 21 days ago
JSON representation
hebr is a command line tool or library for encoding/decoding data in Hebrew characters.
- Host: GitHub
- URL: https://github.com/koki-develop/hebr
- Owner: koki-develop
- License: mit
- Archived: true
- Created: 2022-08-28T00:15:28.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-28T01:18:17.000Z (over 3 years ago)
- Last Synced: 2024-06-20T17:29:52.167Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](./go.mod)
[](https://github.com/koki-develop/hebr/releases/latest)
[](https://github.com/koki-develop/hebr/actions/workflows/main.yml)
[](https://codeclimate.com/github/koki-develop/hebr/maintainability)
[](./LICENSE)
[](https://twitter.com/koki_develop)
# hebr
`hebr` is a command line tool or library for encoding/decoding data in Hebrew characters.
## Contents
- [CLI](#cli)
- [Installation](#installation)
- [Usage](#usage)
- [Encode](#encode)
- [Decode](#decode)
- [Library](#library)
- [Installation](#installation-1)
- [Import](#import)
- [Usage](#usage-1)
- [LICENSE](#license)
## CLI
### Installation
```sh
$ go install github.com/koki-develop/hebr/cmd/hebr@latest
```
### Usage
#### Encode
Data to be encoded can be passed from stdin.
```sh
$ echo hello | hebr
םבעצר,דןבט
```
It is also possible to specify the target file to be encoded.
```sh
$ hebr ./hello.txt
םבעצר,דןבט
```
#### Decode
You can decode data encoded in Hebrew characters by specifying the `-d` or `-decode` flag.
Usage is the same as Encode.
```sh
$ echo 'םבעצר,דןבט' | hebr -d
hello
```
```sh
$ hebr --decode ./hello.txt.hebr
hello
```
## Library
### Installation
```
$ go get github.com/koki-develop/hebr
```
### Import
```go
import "github.com/koki-develop/hebr"
```
### Usage
`hebr` package provides `Encode()` and `Decode()` functions.
```go
package main
import (
"fmt"
"log"
"github.com/koki-develop/hebr"
)
func main() {
data := []byte("data")
// encode data
encoded, err := hebr.Encode(data)
if err != nil {
log.Fatalln(err)
}
fmt.Println(string(encoded))
// => לסנקטרט
// decode data
decoded, err := hebr.Decode(encoded)
if err != nil {
log.Fatalln(err)
}
fmt.Println(string(decoded))
// => data
}
```
## LICENSE
[MIT](./LICENSE)