Questions tagged [hash]

A hash function is any well-defined procedure or mathematical function that converts a large amount of data into a small datum, usually a single integer. For questions about hashtags as used to label content on social media, use hashtag. For questions about URLs and HTML anchors, use fragment-identifier. For questions about Ruby's hash type, use ruby-hash.

hash
Filter by
Sorted by
Tagged with
0 votes
0 answers
4 views

Custom hash and equivalance function for nested unordered_set of custom class

I have a struct MyStruct which I have an unordered_set for which has it's own hashing function MyStructHash so that I can define unordered_set<MyStruct, MyStructHash> struct_set;. MyStruct is ...
B.K Lewis's user avatar
0 votes
0 answers
11 views

Is there a way to specify a salt in dart/flutter so I can use wordpress' salt?

I have a wordpress website. I am making a flutter/dart app. I need to process logins, resetting of passwords, and sending of emails. I want to make sure this is secure. I have had issues using the ...
Erin Skidds's user avatar
0 votes
0 answers
7 views

How are two Cuckoo hashing tables able to store more items than a single hashing table of double the size?

I specialize in deep learning and learned about Cuckhoo hashing from a blog post that said TikTok uses Cuckoo hashing in its large-scale recommender system to reduce the memory footprint of its user ...
user554481's user avatar
  • 1,975
0 votes
0 answers
9 views

How should I create/generate & persist unique identifiers from ion based stringified json?

We have a use case where we need to generate unique IDs corresponding to client provided identifiers which will be a ion string (ionified json). Once the unique IDs are generated, our system will ...
do5's user avatar
  • 51
-4 votes
0 answers
101 views

Why is std::unordered_map slower than std::map? [duplicate]

I'm implementing a Trie using unordered maps. Here's what one node looks like: struct Node { std::unordered_map<char, struct Node*>* children; }; (I know I could just be using an ...
Benjamin Gilbert's user avatar
1 vote
1 answer
58 views

Why is the bit-pattern 001/010/100/000/101 for 5381 significant in the magic constant in the djb2 hash function?

The reason for the number 5381 in the djb hash function was partly answered: Magic Constant 5381: 1. odd number 2. prime number 3. deficient number 4. 001/010/100/000/101 b I am new to C and ...
Luke Sharkey's user avatar
-2 votes
0 answers
20 views

Which probability is low enough to be considered 'will not happen'? [closed]

When selecting parameters for hash collisions, password strength and similar tasks there is always a probability of bad things to happen. How to choose that probability? Personally I choose 1 / 100 ...
Sergey Alaev's user avatar
  • 3,905
0 votes
0 answers
28 views

Cumulative unique ids in SAS

In SAS how to assign IDs that will not be repeated in each SELECT. For example, I have table like this (3 rows, 3 columns, first column is IDs): 100000000000 Dylan [email protected] 100000000001 Rebel ...
Dylan Queen's user avatar
0 votes
0 answers
20 views

How to find how string was "decoded" [closed]

I see some websites use encoded string and decode them on a client. e.g. string is send from server as "ff79ecd6e8a3576f8efebb179a1fd6fb3c669eddf3b2ffb252463248ed0937b0" is display on a page ...
Andurit's user avatar
  • 5,722
0 votes
1 answer
76 views

C++ STL: how does std::unordered set and std::unordered_map hashing work?

I am trying to understand how STL unordered set/map (i.e. hash maps) work. I understood that initial hash table size (i.e. number of buckets) is set to 8 and when more elements are added to the set/...
Andrey Rubliov's user avatar
0 votes
1 answer
33 views

The two tables are join using a hash join without substr in the join condition.Why does substr appear in the predicate information?

ENV: ORACLE DB 19.20 VERSION Test case Create table and index. SQL> create table t100 as select * from dba_objects; SQL> create index idx_substr_object_name on t100 (substr(object_name,1,4)); ...
bin wam's user avatar
0 votes
0 answers
15 views

Deployment integrity protection methods

[I'm not sure if this is the correct place for this kind of meta question. Please suggest another forum if required.] I use python, pandas and a few other python libraries in my data science projects. ...
CharcoalG's user avatar
  • 305
1 vote
1 answer
25 views

Good "hash_func" for unhashable items in streamlit's st.cache_resource - mainly dataframes?

Streamlit's st.cache_resource decorator is key to speeding up streamlit apps. In functions like: @st.cache_resource def slow_function(inputA, input_b): ... return something it can speed up the ...
Myccha's user avatar
  • 988
0 votes
0 answers
11 views

R Script for Power Bi SHA256 incorrect hash value

I used below R script code in Power BI for getting SHA256 encyrption however getting in correct value Code: # 'dataset' holds the input data for this script library(digest) len \<- length(dataset\...
Vanik's user avatar
  • 13
-2 votes
0 answers
20 views

sha256sum varies on files produced in different linux versions? [closed]

On system A I am running Linux 5.4.0-174-generic x86_64 Distributor ID: Ubuntu Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy On system B I am running Linux 5.4.0-174-...
jfrankl8's user avatar
0 votes
0 answers
81 views

Mass password hashing with `bcrypt` algorithm in PHP [closed]

I have a production database which is storing passwords in plain text. Now, we are finally planning to using hash passwords and need to update the entire database. I tried this PHP script to update ...
mohiwalla's user avatar
-1 votes
0 answers
37 views

How i can hash CSS classes in TailwindCSS templates to prevent copying in a Webpack Workflow

I'm using TailwindCSS templates for my web projects and I want to automatically hide CSS classes within my project to prevent copying. Is there a way to achieve this? Additionally, I want the output ...
ali akbar motallebi's user avatar
0 votes
2 answers
47 views

Last four digits in hash must be the same

I have a coding challange where I need the last four characters in a hash to be the same characters. As a start I have a word and then i must add the suffix to give me the hash with the four ...
Delta HD's user avatar
-1 votes
0 answers
54 views

How to propose good hasher for unordered_,map

I use unordered_map with class MajFace represents array of three points. I need to use my own comparator template <> struct equal_to<MajFace> and I must to override also hash struct ...
Michal Hadraba's user avatar
0 votes
0 answers
27 views

AttributeError: 'NoneType' object has no attribute 'hexdigest' with sha256 [duplicate]

#!/usr/bin/env python3 from hashlib import sha256 def produce_digest_char_by_char(word): d=sha256();print(d.hexdigest()) for b in word: #d=d.update(b.encode()):print(d.hexdigest())#...
John Smith's user avatar
0 votes
2 answers
32 views

Why a object of custom class can be the key of a dict, while the list can not in Python?

class MyClassA: def __init__(self, value=0): self.value = value class MyClassB: def __init__(self, value=0, list_=[]): self.value = value self.list = list_ a =...
Na Chen's user avatar
-1 votes
0 answers
52 views

Why do hash functions benefit from being injective, or why are collisions a problem?

I'm a math person, not a CS person. So I'm familiar with functions and injectivity, but having trouble understanding the discussion of hash tables and collisions. I was under the impression that a ...
NovicePatience's user avatar
0 votes
0 answers
30 views

Improving runtime on Pattern matching with most k mismatches

I am trying to improve the runtime of a runtime of the pattern matching problem with most k mismatches. My approach is heavily inspired from this question, which is to slide the pattern "window&...
Andy Nguyen's user avatar
1 vote
1 answer
76 views

SHA256 Endianness problems

For a project, I wanted to implement SHA256 in C from scratch. However, the specification here mixes things up with little and big endianness and makes things unclear. I've coded the entire hashing ...
ampersander's user avatar
0 votes
0 answers
59 views

Corner cases for Longest Common Substring problem?

I have been working on an exercise that gives two string s and t, find the longest common substring by outputting 3 integers: its starting position in s, its starting position in t (all 0-based), and ...
Andy Nguyen's user avatar
0 votes
0 answers
61 views

How to calculate the average number of examined hash values before the first collision?

I am trying to calculate the average number of examined hash values before the first collision occurs. I need to calculate the empirical average and the theoretical average. Here is the function ...
Term's user avatar
  • 1
0 votes
1 answer
48 views

How to properly set hashes in script-src CSP policy header?

I'm trying to get SCP working with hashes. I'm inserting the hashes both in the header (Content-Security-Policy) and in the html page. When I disable CSP and only use SRI, everything works. But when I ...
t1m0th33's user avatar
  • 166
-1 votes
0 answers
24 views

Algorithm for finding the largest common substring for n strings using Rabin-Karp function

I have a code for Algorithm for finding the largest common substring for n strings but it isn't very effective. Can this Algorithm be rewritten using hash-function? for example Rabin-Carp function? ...
Nergigante's user avatar
2 votes
3 answers
54 views

Lua: is there a need to use hash of string as a key in lua tables

I want to keep a list of words (let's say 20k). The only purpose of it is to check if the given word exists there. So, it's going be something known as a hash set. -- dict here is just an example, it'...
papirosnik's user avatar
-1 votes
0 answers
12 views

When the key values are the same, the memory limit is exceeded when making a hash join

When the key values are the same, the memory limit is exceeded when making a hash join Source code comment If we dumped out either all or none of the tuples in the table, disable further expansion of ...
user23777683's user avatar
1 vote
1 answer
23 views

Short for creating an array of hashes in powershell malfunction?

I'm trying to initialize an array of hashes of a specific length in a short way. $array=@(@{"status"=1})*3 This does not work as I expect it to, when I change a value in the hash for one ...
Viktor Stjärne's user avatar
-2 votes
0 answers
15 views

LC347: Top K Frequent Elements; final result returns an extra element in list/array

Leetcode 347 in Python, snippet of my code: class Solution: def topKFrequent(self, nums: List[int], k: int) -> List[int]: dictionary = {} freq = [[] for i in range(len(nums) + 1)...
keepmovingforward's user avatar
1 vote
0 answers
44 views

Hashing vertices of a Graph in C

Relative beginner in C here so go easy on me! Consider the following structures and types: #include <stdint.h> typedef uint32_t u32; typedef u32 color; typedef struct Vertice* vertice; // ...
lafinur's user avatar
  • 290
0 votes
1 answer
36 views

Is there a limit on the message size for SHA3?

With SHA2, there is a limit on the message size. Is there a similar limit with SHA3?
mti's user avatar
  • 233
0 votes
1 answer
28 views

When hashing an API key, should I hash the suffix / prefix as well?

I am generating API key similarly to Stripe where my key is {prefix}_{guid}_{suffix}. Prefix is a constant Guid is the "password" portion of the key Suffix is a random 4 character string ...
Jordan's user avatar
  • 1
1 vote
0 answers
37 views

Cmake error : Configuring incomplete, errors occurred

I was trying to build docker image using command docker-compose -f caMicroscope.yml build and I am getting the following error: CMake Error at build/orthanc/OrthancFramework/Resources/CMake/...
Sanjana Sogimatt's user avatar
0 votes
0 answers
29 views

murmur3 hashing function in postgres

I want to use murmur3 hashing function in postgres , is there any default in postgres . In PostgreSQL do we have any mechanism for fetching this murmur3 hash function for any UUID I haven't go ...
Sush sush's user avatar
2 votes
2 answers
54 views

Hashing the password if it is not hashed in django

When I try to create a password for the user using the admin interface is doesn't get hashed. So I added this line in the user model def save(self, *args, **kwargs): self.set_password(self....
Alpha々 Reaper's user avatar
0 votes
1 answer
58 views

Order of a set in Python

I assumed that when we iterate through a set, the order in which the iteration occurs is based on the increasing order of the hashes of the hash table that corresponds to the set. I wanted to test ...
Rajdeep Sindhu's user avatar
0 votes
0 answers
24 views

Comparing the hash of a file, containing a list of hashes of multiple files instead of each file, is it good?

I am writing a Powershell script that accepts a list of files, compresses them in an archive, and then decompresses it to another path.I intend to check if the final extracted files are identical to ...
EL MAXERO's user avatar
0 votes
0 answers
32 views

3D Space Binning with Intersecting Sphere

I am counting the number of collisions of a very large number of particles, and I want to divide the space with many spheres, intersecting one with the other. I have already managed to divide the ...
liljoanela's user avatar
-2 votes
1 answer
34 views

Hashtable lookup time confusing if hash function is not constant [duplicate]

In the hashtable, we generally say that insertion/lookup time is O(1). I've read that this is only true if hashing function used is of constant time and it's said that constant time depends on the ...
Giorgi Lagidze's user avatar
0 votes
1 answer
59 views

Python Hashing of "tupled" numpy Array

I have a class MyClass where each instance stores pixels' x- and y-coordinates, represented as two 1D numpy arrays (of the same length). Two instances are considered equal if their coordinate arrays ...
Jon Nir's user avatar
  • 529
0 votes
1 answer
56 views

Is xxh64 hash suitable for file integrity check? [closed]

Is xxh64 hash suitable for file integrity check? I have a game and inside this game i wan't to check some files integrity before loading ( 1mb+) to battle cheats. I know that this xxh64 is not ...
Kracken's user avatar
  • 662
0 votes
1 answer
121 views

Hash values do not match

I get a response: Hash values do not match. I have the following code: public string SignSoapMessageVersion(string soapRequest,X509Certificate2 certificate) { RSA privateKey = certificate....
Daan1986's user avatar
0 votes
0 answers
24 views

How to get updates from gitlab API if topics changed?

updated_at or last_activity_at don't have any effect on changing a topic. But i really would need to have this info. Is there a way or do anyone have an idea how i can notice if topics are changed ? I ...
Oliver's user avatar
  • 1
1 vote
3 answers
47 views

How do I search and find a specific value in a hash in a list? Python

I am an amateur Python user, so bear with me. I created a list, and filled it with hashes. But I am having trouble, because I need to search the entire list to find the first hash with a specific ...
Dean Ng's user avatar
  • 11
0 votes
1 answer
95 views

Change Executable Hash Algorithm

We have an application build in .NET Framework 4.8, and for security issue we need to change the Hash Algorithm from SHA-1 to SHA-256. We find this hash algorithm trough ILSPY( as you can see on the ...
Emilio Marino's user avatar
0 votes
0 answers
24 views

Issue to create a Yara rule using the ssdeep fuzzy hashing technique

I am trying to create a Yara rule using the ssdeep fuzzy hashing technique, I understand that my Yara rule should look like this: import "hash" rule SuspiciousSSDeep { meta: ...
user23567008's user avatar
0 votes
0 answers
41 views

How to properly partition by hashkey in spark (to achieve co-partitioning)?

I am implementing a Data Vault hub, and have X number of columns, 2 of them being: Company_ID, md_5(Company_id).alias(HK_company_ID) The hash is created on the stage level, and I want to load my data ...
PipelineSurfer's user avatar

1
2 3 4 5
481