Skip to content

someburner/libhydrogen-go

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

libhydrogen-go

Golang wrapper for libhydrogen.

Usage

If libhydrogen is already installed system-wide, just go get the project and import libhydrogen-go like anything else. Otherwise, you may build and install libhydrogen.a from the submodule directory.

Note: libhydrogen-go is only tested to work against the version of libhydrogen included as a submodule in this repo.

Specifying libhydrogen location: See the make run_custom_ld target in Makefile for example.

Note: If editing / recompiling libhydrogen and then running tests, it may be necessary to build with the -a flag to force a rebuild. See make rebuild target in Makefile for example.

# add as go mod dependency
go get github.com/someburner/libhydrogen-go

// and use in project
package main

import (
	"fmt"
	hydro "github.com/someburner/libhydrogen-go"
)

func main() {
	fmt.Println(hydro.VersionVerbose())
}

Install libhydrogen

# to build inside submodule, or run the examples
git clone --recursive https://github.com/someburner/libhydrogen-go.git
cd libhydrogen-go

# build/install libhydrogen
cd libhydrogen
make
sudo make install

Examples

See example. Or run with make.

make run

Links

Credits

Several methods in core.go taken from libsodium-go.