go/

directory
v0.0.0-...-ba74d44 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0

README

JSON Canonicalizer for Go

The jsoncanonicalizer folder contains the source code for a JCS (RFC 8785) compliant JSON canonicalizer written in Go.

Building and testing

  • Set GOPATH to this directory.

  • For running verify-numbers.go you need to download a 3Gb+ file with test data described in the root directory testdata. This file can be stored in any directory and requires updating the file path in verify-numbers.go.

  • Perform the commands:

$ cd test
$ go build webpki.org/jsoncanonicalizer
$ go run verify-canonicalization.go
$ go run verify-numbers.go

Using the JSON canonicalizer

import "webpki.org/jsoncanonicalizer"

func Transform(jsonData []byte) (result []byte, e error)

Note that both the input and the result is assumed to be in UTF-8 format.

Constraints

The JSON canonicalizer only accepts a JSON Object or Array as the top level data type.

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

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