khash

package
v1.76.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package khash provides the kDrive specific hash handling.

kDrive uses XXH3-64 for file hashing. Files uploaded in chunks (by rclone, or by the kDrive apps which each use their own chunk size) get a "nested" hash: the XXH3 of the concatenated lowercase hex strings of the individual chunk hashes. Such a nested hash can't be compared with a plain XXH3 of the file contents.

Hash formats returned by the kDrive API:

  • "xxh3:HASH" for a plain XXH3 of the file contents
  • "N:xxh3:HASH" for the nested hash of a chunked upload

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NestedChunkHash

func NestedChunkHash(chunkHashes []string) (string, error)

NestedChunkHash computes the kDrive nested hash from the hashes of the file chunks, in order.

kDrive stores the nested hash of a chunked file as the XXH3 of the concatenated lowercase hex strings of the individual chunk hashes. Each chunk hash may be passed with or without the "xxh3:" prefix.

func ParseHash

func ParseHash(hashStr string) (hexHash string, isNested bool, err error)

ParseHash parses a kDrive hash string from the API and returns the hex hash value along with whether it is a nested (chunked) hash.

Types

This section is empty.

Jump to

Keyboard shortcuts

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