problems

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsProblemPackage

func IsProblemPackage(filePath string) (bool, error)

判断是否是题目包

func PackProblems

func PackProblems(
	configuration *commonStructs.JudgeConfiguration,
	options *persistence.ProblemPackageOptions,
) error

func ReadProblemGPGInfo

func ReadProblemGPGInfo(problemFile string) (string, error)

读取题目携带的GPG信息

func ReadProblemInfo

func ReadProblemInfo(problemFile string, unpackBody, validate bool, workDir string) (*commonStructs.JudgeConfiguration, string, error)

读取题目信息

Types

type ProblemPackage

type ProblemPackage struct {
	Version         uint16 // (VER) Package Version
	CommitVersion   uint32 // (CMT) Commit Version
	ConfigSize      uint32 // (CSZ) Config JSON Text Size
	BodySize        uint32 // (BSZ) Result Body Size
	CertSize        uint16 // (PCSZ) Public Certificate Size
	SignSize        uint16 // (SSZ) Signature Size
	Certificate     []byte // Public Certificate
	Signature       []byte // Signature: SHA256(Result + Body)
	Configs         []byte // Configs JSON
	BodyPackageFile string // Body package file
}

******** ------------------------ |MAG|VER|CMT|CSZ|BSZ|PCSZ| Certificate |SSZ| Signature | Result | Body ------------------------ | 2 | 2 | 4 | 4 | 4 | 2 | ... | 2 | ... ------------------------ *********

Jump to

Keyboard shortcuts

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