Questions tagged [hashing]
A hash function is any algorithm that maps data of arbitrary length to data of a fixed length. The values returned by a hash function are called hash values, hash codes, hash sums, checksums or simply hashes. From Wikipedia: http://en.wikipedia.org/wiki/Hash_function
166 questions
3votes
3answers
159views
Why does the collection library for Dart use a bit mask for hashing collections?
I was implementing a hashing function for a class and I took a minute to look at the first-party collection package for Dart to see how they implemented their hashing function for collections. They ...
-1votes
2answers
192views
Are there any standards for storing checksums of a repository?
I have a repository with many files (mostly binary, images and raw data) and some documentation. The files are stored in a hierarchical folder structure; I want to allow checking the fixity of the ...
0votes
1answer
108views
How to rebalance data across nodes?
I am implementing a message queue where messages are distributed across nodes in a cluster. The goal is to design a system to be able to auto-scale without needing to keep a global map of each message ...
4votes
2answers
621views
How should I handle different hashes of identical files in .zip archive with different 'last changed' date?
We store zipped files in the storage of a cloud provider which contain certain fields (metadata). These files are derived from other, larger files. Every time we (re)generate these files, their 'last ...
5votes
5answers
6kviews
How can I protect an SQL connection string in a client-side application?
I am developing a .NET Windows application and I need to make requests to a SQL Server instance. How do I secure the authentication data in my code in case someone decompiles my application? I know ...
6votes
3answers
1kviews
What is the benefit of caching a hash value in a string object?
I made a patch to a programming language run-time to cache the results of hashing a string in the string object, so that it is just retrieved the next time it is required. However, I'm not convinced ...
2votes
1answer
1kviews
What are Hash Functions? [closed]
I am trying to read up on System Design, and several articles talk about how a Primary Key for the input data, which is a string, can be passed into a Hash function and we get a number. This can ...
0votes
1answer
2kviews
Why is there no Hashmap in C++ like Java? [closed]
I know that the C++ standard library includes the ordered and the unordered map (std::map and std::unordered_map) containers, but why is there no hashmap available on C++? I was asked this questions ...
3votes
2answers
1kviews
Modulo Division of Hash Output
In a design book I was reading they describe a method to determine a database sharding scheme by taking the hash (MD5, SHA1, whatever) of a userid (integers or uuids) and then (whether encoded or not) ...
0votes
0answers
747views
Designing a unique id reliably based on a String date?
I am creating an Android application that sets alarms based on the String date of a list of Objects (PendingIntents, with each taking in an id, that is an integer). In order to cancel the ...
2votes
2answers
298views
Is there a reliable way to get get the fingerprint of a file hosted online, without fully downloading it?
Background Tertiary to this question, I have been building my own imageboard that prevents [for example] duplicate images from being downloaded again and again on behalf of the client. How I do this, ...
3votes
1answer
1kviews
Is consistent hashing required for sharding?
I am reading about scaling of database and came to know about sharding technique. But I also read about consistent hashing technique. So how practically sharding is implemented? Do we arrange nodes in ...
1vote
1answer
4kviews
Is it ok to use redis scan extensively?
In redis docs, it is stated that keys command should not be used in production, since it blocks other processes while executing, it is better to use scan iteration over all keys with some batch size. ...
5votes
1answer
2kviews
Why use strong checksums to detect random errors in a filesystem like btrfs?
Btrfs supports crc32c, xxhash, sha256 and blake2b as checksums when storing and reading files. crc32c and xxhash are designed to detect random errors while sha256 and blake2 are considered ...
-4votes
4answers
3kviews
Time efficient way to count pairs in an array whose sum is divisible by a specific number?
Given an array of integers, we want to find how many explicit pairs can be made such that their sum is divisible by 60. The pairs are not necessarily non-unique. For example, let's say the input into ...