oe

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2019 License: CC0-1.0 Imports: 2 Imported by: 1

README

oe

pipeline status coverage report Contributor Covenant

Implementation of the Progress OpenEdge ENCODE algorithm based on the CSharp and JAVA implementations as found in the pvginkel/ProgressEncode repository on GitHub.

Install

go get -u lab.madbox.synology.me/gophers/oe

Examples

// Either use the helper function Sum():
a := oe.Sum([]byte("admin"))
fmt.Println(string(a[:]))
// Output: aaLldOCddklvMUWh

// Or use a distinct hash.Hasher (useful when creating multiple hashes):
hasher := oe.New()
_, err := hasher.Write([]byte("admin"))
if err != nil {
  // ...
}
b := hasher.Sum(nil)
fmt.Println(string(b))
// Output: aaLldOCddklvMUWh

// Before reusing hasher, call Reset(), else it keeps appending.
hasher.Reset()

Contributing

When contributing to this project, please note our Code of Conduct.

License

The CC0 1.0 Universal (CC0 1.0) Public Domain Dedication - see LICENSE or CC0 1.0 Universal (CC0 1.0) Public Domain Dedication for more details

Documentation

Overview

Package oe implements the Progress OpenEdge encode algorithm.

Index

Examples

Constants

View Source
const BlockSize = 16

BlockSize is the blocksize of OEencode in bytes.

View Source
const Size = 16

Size is the size of an OEencode checksum in bytes.

Variables

This section is empty.

Functions

func New

func New() hash.Hash

New returns a new hash.Hash computing OEencode checksums.

func OEcheck

func OEcheck(input string) bool

OEcheck does a simple verification of the input stream.

func Sum

func Sum(data []byte) [Size]byte

Sum returns the OEencode checksum of given byte array.

Example
h := Sum([]byte("admin"))
fmt.Println(string(h[:]))
Output:

aaLldOCddklvMUWh

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL