|
16 | 16 | /// |
17 | 17 | /// Usage: |
18 | 18 | /// * Write a key generator function returning a string |
19 | | -/// The parameters to CA_GenKey() must completely determine the wave you will later store. |
| 19 | +/// The parameters to CA_GenerateKeyFancyCalc() must completely determine the wave you will later store. |
20 | 20 | /// The appended version string to the key allows you to invalidate old keys |
21 | 21 | /// if the algorithm creating the wave changes, but all input stays the same. |
22 | 22 | /// |
23 | 23 | /// \rst |
24 | 24 | /// .. code-block:: igorpro |
25 | 25 | /// |
26 | | -/// Function/S CA_GenKey(string input) |
| 26 | +/// Function/S CA_GenerateKeyFancyCalc(string input) |
27 | 27 | /// |
28 | | -/// return HashString("", input) + "Version 1" |
| 28 | +/// return HashString("", input) + ":FancyCalc:Version 1" |
29 | 29 | /// End |
30 | 30 | /// \endrst |
31 | 31 | /// |
|
39 | 39 | /// |
40 | 40 | /// Function/WAVE MyFancyCalculation(string input) |
41 | 41 | /// |
42 | | -/// string key = CA_GenKey(input) |
| 42 | +/// string key = CA_GenerateKeyFancyCalc(input) |
43 | 43 | /// |
44 | 44 | /// WAVE/Z result = CA_TryFetchingEntryFromCache(key) |
45 | 45 | /// |
@@ -561,35 +561,6 @@ threadsafe Function/S CA_CalculateFetchEpochsKey(WAVE numericalvalues, WAVE text |
561 | 561 |
|
562 | 562 | return hv + ":Version 1" |
563 | 563 | End |
564 | | - |
565 | | -Constant HASH_XX3_64 = 102 |
566 | | - |
567 | | -threadsafe Function/S HashNumber(string previousHash, variable num) |
568 | | - |
569 | | - string str = num2strHighPrec(num, precision = MAX_DOUBLE_PRECISION) |
570 | | - |
571 | | - return HashString(previousHash, str) |
572 | | -End |
573 | | - |
574 | | -threadsafe Function/S HashString(string previousHash, string str) |
575 | | - |
576 | | - ASSERT_TS(!IsEmpty(str), "str can not be empty") |
577 | | - |
578 | | -#if IgorVersion() >= 10 |
579 | | - return Hash(previousHash + str, HASH_XX3_64) |
580 | | -#endif |
581 | | - |
582 | | - return num2istr(StringCRC(str2num(previousHash), str)) // NOLINT |
583 | | -End |
584 | | - |
585 | | -threadsafe Function/S HashWave(string previousHash, WAVE/Z wv) |
586 | | - |
587 | | -#if IgorVersion() >= 10 |
588 | | - return previousHash + WaveHash(wv, HASH_XX3_64) |
589 | | -#endif |
590 | | - |
591 | | - return num2istr(WaveCRC(str2num(previousHash), wv)) // NOLINT |
592 | | -End |
593 | 564 | ///@} |
594 | 565 |
|
595 | 566 | /// @brief Make space for one new entry in the cache waves |
|
0 commit comments