File tree Expand file tree Collapse file tree
src/FSharp.Data.GraphQL.Client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ open System.Security.Cryptography
1111/// Extensions for types used by the GraphQL client library.
1212[<AutoOpen>]
1313module internal Extensions =
14+
1415 type String with
1516 /// Returns the input string with the first character in upper case.
1617 member this.FirstCharUpper () =
@@ -20,11 +21,13 @@ module internal Extensions =
2021 member this.FirstCharLower () =
2122 this.Substring( 0 , 1 ) .ToLowerInvariant() + this.Substring( 1 )
2223
23- member this.MD5Hash () =
24- Encoding.UTF8.GetBytes( this)
25- |> MD5.Create() .ComputeHash
24+ /// Returns a lowercase hex MD5 hash of the UTF-8 bytes of this string.
25+ member this.MD5Hash () =
26+ use md5 = MD5.Create()
27+
28+ md5.ComputeHash ( Encoding.UTF8.GetBytes this)
2629 |> Seq.map _. ToString( " x2" )
27- |> Seq.reduce (+)
30+ |> String.Concat
2831
2932/// Basic operations on lists.
3033module internal List =
You can’t perform that action at this time.
0 commit comments