473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Remove Extra ComputeHash Buffer Allocation

Right now, the HashAlgorithm.ComputeHash method always creates a new byte array to return the computed hash. Creating a new byte array is wasteful in the case where the caller has an array available for receiving the hash.

How about, in a future version of .NET, having a variant of ComputeHash that accepts arguments that specify where the computed hash is to be returned, e.g., two arguments, one specifying a byte array and the other specifying an offset into the array?
---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
Nov 16 '05 #1
0 1344

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tomasz Grobelny | last post by:
Is it possible to create for example stl queue in previously allocated memory buffer (memory shared between two processes)? I thought of sth like that: queue<int>* q=new(buffer) queue<int>; but...
2
by: collinm | last post by:
hi here my code FILE *fp; char *line; #define LINE_MAX 30 fp = fopen("test1.txt", "r");
0
by: Andrew | last post by:
Right now, the HashAlgorithm.ComputeHash method always creates a new byte array to return the computed hash. Creating a new byte array is wasteful in the case where the caller has an array available...
3
by: Amy L. | last post by:
Is there a Buffer size that is optimial based on the framework or OS that is optimal when working with chunks of data? Also, is there a point where the buffer size might not be optimal (too...
0
by: He Shiming | last post by:
Hi All, In my COM (component object model) server DLL I created, there are these methods that require buffer allocation. They look like this: class CComClass : public IClass { // just for...
28
by: bwaichu | last post by:
Is it generally better to set-up a buffer (fixed sized array) and read and write to that buffer even if it is larger than what is being written to it? Or is it better to allocate memory and...
2
by: marco.furlan | last post by:
Hi there, I have to write an optimized circular buffer to log events in C++. The elements are of type std::string. This should run under Linux on an ARM embedded system. I can dedicate to this...
1
by: semedao | last post by:
Hi, I saw that when I use ComputeHash on large file stream the ComputeHash method don't read all the stream first and than hash it , it's read it in chunks (memory performance?) How can I know the...
6
by: Hongbo | last post by:
Hi, I use System.Security.Cryptography.HashAlgorithm.ComputeHash() method with SHA512 to encrypt password. I recently upgrade my website from .Net 1.1 to .Net 2.0. The passwords stop working....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.