converter

package
v1.11.0 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 Imports: 4 Imported by: 0

Documentation

Overview

Convert file-format signature sequences to something compatible with Siegfried's identifiers.

Index

Constants

View Source
const (
	// UnknownEncoding provides us with a default to work with.
	UnknownEncoding = iota
	// HexEncoding describes magic numbers written in plain-hexadecimal.
	HexEncoding
	// PronomEncoding describe PRONOM based file format signatures.
	PronomEncoding
	// PerlEncoding describe PERL regular expression encoded signatures.
	PerlEncoding
	// ASCIIEncoding encoded patterns are those written entirely in plain ASCII.
	ASCIIEncoding
	// GUIDEncoding are globally unique identifiers.
	GUIDEncoding
)

Encoding enumeration to return unambiguous values for encoding from the mapping lookup below.

Variables

This section is empty.

Functions

func ASCIIParser

func ASCIIParser(signature string) string

ASCIIParser returns a hexadecimal representation of a signature written using ASCII encoding.

func GetPronomEncoding added in v1.9.2

func GetPronomEncoding() string

GetPronomEncoding returns the PRONOM encoding URI as is set locally in the package.

func GetPronomURIFromConfig added in v1.9.2

func GetPronomURIFromConfig()

GetPronomURIFromConfig will read the current value of the PRONOM property from the configuration, e.g. after being updated using a custom SPARQL query.

func HexParse

func HexParse(signature string) (string, error)

HexParse will take a hexadecimal based signature and do something useful with it...

func LookupEncoding

func LookupEncoding(encoding string) int

LookupEncoding will return a best-guess encoding type for a supplied encoding string.

func PERLParser

func PERLParser(signature string) (string, bool)

PERLParser will take a very limited range of PERL syntax and convert it to something PRONOM compatible.

func Parse

func Parse(signature string, encoding int) (string, bool, int, error)

Parse will take a signature and convert it into something that can be used. If the signature needs to be converted then the function will inform the caller and return the new encoding value.

func ReverseEncoding

func ReverseEncoding(encoding int) string

ReverseEncoding can provide a human readable string for us if we ever need it, e.g. if we need to debug this module.

Types

This section is empty.

Jump to

Keyboard shortcuts

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