aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/hash.cc
AgeCommit message (Collapse)Author
2024-08-04tree-wide: fix various lint warningsJade Lovelace
Change-Id: I0fc80718eb7e02d84cc4b5d5deec4c0f41116134
2024-07-05libutil: convert readFileSource to a generatoreldritch horrors
Change-Id: I5f92b15fd367d46eb047d74ab6e317b4f51a46d3
2024-07-05libstore: convert dumpPath to a generatoreldritch horrors
Change-Id: Ic4cf5562504aa29130304469936f958c0426e5ef
2024-06-19libutil: return a source from readFileeldritch horrors
don't consume a sink, return a source instead. the only reason to not do this is a very slight reduction in dynamic allocations, but since we are going to *at least* do disk io that will not be a lot of overhead anyway Change-Id: Iae2f879ec64c3c3ac1d5310eeb6a85e696d4614a
2024-05-29util.hh: Delete remaining file and clean up headersTom Hubrecht
Change-Id: Ic1f68e6af658e94ef7922841dd3ad4c69551ef56
2023-04-17Merge pull request #7732 from hercules-ci/make-initLibStore-viable-alternativeJohn Ericson
Make `initLibStore` a viable alternative
2023-04-07Require openssl >= 1.1.1Robert Hensing
Versions older this are sufficiently old that we don't want to support them, and they require extra support code.
2023-04-07Move OpenSSL init to initLibUtilRobert Hensing
Part of an effort to make it easier to initialize the right things, by moving code into the appropriate libraries.
2023-04-07Rename and protect `BufferedSink::write`Théophane Hufschmitt
The `write` name is ambiguous and could lead to some funny bugs like https://github.com/NixOS/nix/pull/8173#issuecomment-1500009480. So rename it to the more explicit `writeUnbuffered`. Besides, this method shouldn't be (and isn't) used outside of the class implementation, so mark it `protected`. This makes it more symetrical to `BufferedSource` which uses a `protected readUnbuffered` method.
2023-03-29avoid a string copy in printHash16Vaci Koblizek
2023-03-29return string_view from printHashType rather than stringVaci Koblizek
2023-03-28Avoid a string copy during Hash::to_stringVaci Koblizek
2022-04-07don't assume that rev is a SHA1 hashKasper Gałkowski
This was a problem when writing a fetcher that uses e.g. sha256 hashes for revisions. This doesn't actually do anything new, but allows for creating such fetchers in the future (perhaps when support for Git's SHA256 object format gains more popularity).
2022-02-25Remove std::string alias (for real this time)Eelco Dolstra
Also use std::string_view in a few more places.
2022-01-27return string_views from forceString*pennae
once a string has been forced we already have dynamic storage allocated for it, so we can easily reuse that storage instead of copying.
2020-12-02Sink: Use std::string_viewEelco Dolstra
2020-10-28ConsistencyEelco Dolstra
2020-08-05Add Hash::dummy to signal default valueCarlo Nucera
We did this in the same spirit of the dummy value that's present in libstore/path.hh
2020-07-20Remove period at the end of the exception messageJohn Ericson
2020-07-20parser.hh -> split.hhJohn Ericson
2020-07-16Merge branch 'hash-always-has-type' of github.com:obsidiansystems/nix into ↵John Ericson
better-ca-parse-errors
2020-07-16Merge remote-tracking branch 'upstream/master' into hash-always-has-typeJohn Ericson
2020-07-15Merge branch 'master' of github.com:NixOS/nix into hash-always-has-typeCarlo Nucera
2020-07-14Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-07-13Remove istringstream_nocopyEelco Dolstra
2020-07-06Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-07-03Merge branch 'hash-always-has-type' of github.com:obsidiansystems/nix into ↵John Ericson
better-ca-parse-errors
2020-07-03Merge branch 'master' of github.com:NixOS/nix into hash-always-has-typeJohn Ericson
2020-07-02Have `splitPrefix` and `splitPrefixTo` parser helpersJohn Ericson
2020-07-02Move `getParsedTypeAndSRI` to a more suitable locationJohn Ericson
Also mark it static
2020-07-02Fix abort in 'nix develop'Eelco Dolstra
2020-07-02Write the implementation for parseNonSRIUnprefixedCarlo Nucera
2020-07-02Abstract common parsing functionalityCarlo Nucera
2020-07-02Inline and simplify in parseAnyPrefixedCarlo Nucera
2020-07-02Rename fromSRI to parseSRI for constistencyCarlo Nucera
2020-07-02Get rid of the std::pairCarlo Nucera
2020-07-02Inline newFunctionCarlo Nucera
2020-07-02Fix test suiteCarlo Nucera
2020-07-01Rename two hash constructors to proper functionsCarlo Nucera
2020-07-01Inline Hash::init()Carlo Nucera
2020-07-01Keep the previous name, for diffingCarlo Nucera
2020-07-01Fixed build, we still have test errorsCarlo Nucera
2020-06-30WIP initial designCarlo Nucera
2020-06-30Factor the prefix splitting in hashCarlo Nucera
2020-06-29Merge remote-tracking branch 'upstream/master' into hash-always-has-typeJohn Ericson
2020-06-26Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-06-25Fix empty std::optional dereference in writeDerivation()Eelco Dolstra
https://hydra.nixos.org/build/123017579
2020-06-23Fix and clean up hash parserJohn Ericson
2020-06-23Merge remote-tracking branch 'upstream/master' into hash-always-has-typeJohn Ericson
2020-06-19WIP: Make Hash always store a valid hash typeJohn Ericson