Documentation
¶
Overview ¶
Copyright (c) 2020 Wind River Systems, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Copyright (c) 2020 Wind River Systems, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Copyright (c) 2020 Wind River Systems, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewVersionTwo ¶
func NewVersionTwo() hasher.FileCollectionHasher
Types ¶
type Version ¶
type Version uint8
const (
VERSION_TWO Version = 2
)
func VersionOf ¶
VersionOf checks the slice of bytes to figure out the version of fvc used and returns the version and error
func VersionOfHex ¶
VersionOfHex checks the hex string to figure out the version of fvc used and returns the version and error
type VersionTwoHasher ¶
type VersionTwoHasher struct {
// contains filtered or unexported fields
}
func (*VersionTwoHasher) AddSha256 ¶
func (h *VersionTwoHasher) AddSha256(b []byte) error
AddSha256 is used to add a file's SHA256 from the slice of bytes when the data used is the metadata from the database instead of the directory of file, returns an error in case of failure.
func (*VersionTwoHasher) AddSha256Hex ¶
func (h *VersionTwoHasher) AddSha256Hex(s string) error
AddSha256Hex is used to add a file's SHA256 from the hex string when the data used is the metadata from the database instead of the directory of file, returns an error in case of failure.
func (VersionTwoHasher) Hex ¶
func (h VersionTwoHasher) Hex() string
Hex converts the fvc from slice of bytes to hex string
func (*VersionTwoHasher) ReadFile ¶
func (h *VersionTwoHasher) ReadFile(r io.Reader) error
ReadFile is used to take in a parameter of type io.Reader as input, calculate the SHA256 of the file and adding it to the list, returns an error in case of failure
func (VersionTwoHasher) Sum ¶
func (h VersionTwoHasher) Sum() []byte
Sum is used to sort the list of files and calculating the SHA1 of the list and returns the fvc as a slice of bytes