util

package
v0.0.0-...-7c31ad9 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChunkifyHash

func ChunkifyHash(wareID api.WareID) (string, string, string)

Return a first, second, and remaining chunk of a ware's hash as strings.

These are the first three, second three, and remaining bytes of the string. For base58 encoded values, these first two chunks used as dir prefixes are a cozy density for storing many many thousands of objects:

If the hash is too short, we return a bunch of dashes. (The hash is probably invalid semantically anyway, but we're not going to error about that here.) A hash of empty string will result in a return of `"---", "---", "-"` (in other words, as if the hash had been padded to a min of 7 characts, all dashes).

Types

This section is empty.

Jump to

Keyboard shortcuts

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