We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3b05c1e + 2dd182c commit 3884515Copy full SHA for 3884515
1 file changed
src/FSharp.Data.Runtime.Utilities/Caching.fs
@@ -55,7 +55,15 @@ let createInMemoryCache (expiration: TimeSpan) =
55
/// Get hash code of a string - used to determine cache file
56
let private hashString (plainText: string) =
57
let plainTextBytes = Encoding.UTF8.GetBytes(plainText)
58
- let hashBytes = SHA1.Create().ComputeHash(plainTextBytes)
+
59
+ let hashBytes =
60
+#if NET5_0_OR_GREATER
61
+ SHA1.HashData(plainTextBytes)
62
+#else
63
+ use sha1 = SHA1.Create()
64
+ sha1.ComputeHash(plainTextBytes)
65
+#endif
66
67
let s = Convert.ToBase64String(hashBytes)
68
s.Replace("ab", "abab").Replace("\\", "ab")
69
0 commit comments