Example #1
0
        public static IEnumerable <string> YieldSha256Hash(int count)
        {
            var i = 0;

            while (i < count)
            {
                i++;
                yield return(Sha256Service.ComputeSha256Hash(i.ToString()));
            }
        }
Example #2
0
        public static async IAsyncEnumerable <string> YieldSha256HashAsync(int count)
        {
            var i = 0;

            while (i < count)
            {
                i++;
                await Task.Delay(1000); //something takes a while

                yield return(Sha256Service.ComputeSha256Hash(i.ToString()));
            }
        }