Skip to content

Latest commit

 

History

History
84 lines (71 loc) · 3.07 KB

README.md

File metadata and controls

84 lines (71 loc) · 3.07 KB

go-rfc1751_logo.png

Mnemonics with RFC1751 format

Go Release License Build Coverage

GoReportCard Activity Commits Downloads GoDoc

About project

The RFC1751 encoding in Go language. The code is mostly rewritten from the Python implementation. Tested on examples of repositories remram44/python-rfc1751, vmizg/rfc1751.js, arokettu/php-rfc1751.

Installation

$ go get github.com/number571/go-rfc1751

Requirements

  1. Go version >= 1.16

Functions

r := rand.New(rand.NewSource(1)) // insecure: used math/rand
fmt.Println(NewMnemonic(r, 128))
// Output: BARK TROD AMY UP LUG KNOB GAS WHEN NEWT POT KEY MEAN
b := []byte{204, 172, 42, 237, 89, 16, 86, 190}
fmt.Println(EncodeToString(b))
// Output: RASH BUSH MILK LOOK BAD BRIM
s := "RASH BUSH MILK LOOK BAD BRIM"
fmt.Println(DecodeString(s))
// Output: [204 172 42 237 89 16 86 190] <nil>

License

Licensed under the MIT License. See LICENSE for the full license text.

⬆ back to top