Expand description
Cache functions, serde + serde_json
Structs§
- Cache
- Used to manage cache, rather than passing arguments in main() a lot
Enums§
- IsCached
- Cache order
Constants§
- CACHE_
VER - Cache versioning, to avoid breaks and missreadings. For example, when there is an internal change in how the scheme is generated, the cache format won’t change, however, there is a need for a regeneration, so we bump up the version.
Functions§
- base36
- simple base36 encoding Also, there is no need to decode, since it should match if the contents of the file are the same, else just generate a new scheme. ref: https://stackoverflow.com/questions/50277050/format-convert-a-number-to-a-string-in-any-base-including-bases-other-than-deci
- fnv1a
- Pretty fcking fast hashing the 32 bit version, should be enough for this use case Ref: https://en.m.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
- write_
json - path is the new location of the file to be written to
value the contents of it,
cachepathis only to print the cache absolute path, and pretty to use serde_to_string_pretty