mirror of
https://github.com/NixOS/nix
synced 2025-07-07 06:01:48 +02:00
Add function to extract hash part of a store path
This commit is contained in:
parent
74f954ee62
commit
d089372565
3 changed files with 15 additions and 2 deletions
|
@ -339,6 +339,9 @@ public:
|
|||
};
|
||||
|
||||
|
||||
const size_t storePathHashLen = 32; // base-32 characters, i.e. 160 bits
|
||||
|
||||
|
||||
/* !!! These should be part of the store API, I guess. */
|
||||
|
||||
/* Throw an exception if `path' is not directly in the Nix store. */
|
||||
|
@ -350,6 +353,9 @@ bool isStorePath(const Path & path);
|
|||
/* Extract the name part of the given store path. */
|
||||
string storePathToName(const Path & path);
|
||||
|
||||
/* Extract the hash part of the given store path. */
|
||||
string storePathToHash(const Path & path);
|
||||
|
||||
void checkStoreName(const string & name);
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue