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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
31 views

Too many if statements? Display div on page depends on hash param

I have multiple pages (about 250) and they each have a button at the end of the page that will send the user to the same page consisting of the download link. So, on click of those buttons the user ...
Phillyday's user avatar
  • 105
0 votes
0 answers
22 views

Implementing a special type of array class in Python feasibility

A special array class where you can update and lookup a value and it returns the earliest index that the value exists in the array. And u can update given an index and a value. Is it possible to do ...
J C's user avatar
  • 1
0 votes
1 answer
66 views

C# : generating random integers from nonrandom seeds

I'm making a game, and every now and then a number of objects in the game need to know whether or not the player has moved. Because of the large numbers of objects involved, instead of alerting every ...
a52's user avatar
  • 234
0 votes
0 answers
19 views

How can you determine the default length of an HMAC openssl digest?

I need to find the number of bits (and/or hex digits) generated by an openssl HMAC digest. I generated the following function which can be included with source command, but I could not tease out a ...
sailnfool's user avatar
0 votes
1 answer
26 views

Do Equatable need to be immutable

Is there real case scenarios of not following immutable leading to wrong hash outcome? I've made a test case to test the non-immutable class and was expecting it to have an error. In reality we do not ...
Nikita Shadkov's user avatar
-2 votes
0 answers
46 views

Dict[Enum] by value?

I built an enum and used it as keys for a dictionary. Unfortunately, the dict hash seems to be treating the enum as a normal object instead of using just the value? from enum import Enum, auto class ...
Sam Greenberg's user avatar
-1 votes
0 answers
40 views

Problem understanding FileZilla Server Pro Enterprise hash and salt externally generated

In order to automate the creation of an SFTP user on FileZilla Server Pro Enterprise, I've created a script to create it by modifying the users.xml file. For the record, the version of FileZilla ...
Andréa Madrid's user avatar
0 votes
1 answer
59 views

Rust sha1::Sha1 result is different from shasum [duplicate]

I'm computing the SHA1 digest in Rust via sha1 crate and use the values as a part of a larger utility. use sha1::{Digest, Sha1}; fn main() { for s in vec![ "a", "...
devforfu's user avatar
  • 1,572
0 votes
1 answer
40 views

how to do prediction using model learned by sklearn feature hasher

I encoded my data using feature hasher, the accuracy i am getting on training data is about 90 percent, but still i am not able to predic the new data_points by model, i guess something is wrong with ...
Aditya Bhat's user avatar
0 votes
1 answer
41 views

Time Complexity of accessing [class variables,functions] vs [dictionary values,keys] in Python3

I implemented trie by using classes and by dictionaries separately and got different runtimes.Trie implementation with dictionaries worked about 2.5 times faster than trie with classes when input size ...
Ahmet Cicek's user avatar
0 votes
1 answer
47 views

What is the conceptual opposite of hashing?

Context: Let's say I perform hash the following strings with the respective results: "Hello World" -> 7 "Hello Word" -> 4 "Hello World! Today is a new day to learn ...
Andres Holguin's user avatar
0 votes
1 answer
53 views

Set and modify model value depending on other model value

I have this model: class GiftCard extends Model { use HasFactory; protected $fillable = [ 'number', 'hashed_number', 'security_code' ]; protected function securityCode(): Attribute {...
developer_hatch's user avatar
-1 votes
2 answers
63 views

Sorted set searching and ordering

Python Sorted Containers package contains SortedSet, that can be initialized as follows: __init__(iterable=None, key=None) key: Function used to extract comparison key from values. Sorted set ...
Abhijit Sarkar's user avatar
1 vote
0 answers
30 views

How to query moves in the Opening Book (.obk) of Xiangqi (Chinese Chess)

I'm creating a Xianqi GUI to read Opening Books ( .obk ), I'm stuck on the step how to get the moves from books that matching with current positions of pieces on the board, in books every the moves ...
biên nguyễn's user avatar
1 vote
1 answer
41 views

Canonicalization of an XML document in PHP

I am trying to canonicalize an XML document in PHP. Here is the XML document: <?xml version="1.0" encoding="ISO-8859-1"?> <Envelope xmlns="http://example.org/envelope&...
Hussain Alslais's user avatar
-4 votes
1 answer
35 views

I need to decode phpbb hash

I need to decode phpbb hash: $H$90XT/e6H/nFbrMNBEpt/O.l36C60nc1 i know salt : 2d94e744fd5c9922 how can i know password??? i foudn one code but can't use that: EVEN IF I KNOW FINISH RESULT OF HASH = ...
Uspanoff's user avatar
-5 votes
1 answer
29 views

how to create a sha256 from an object in javascript? [closed]

https://www.npmjs.com/package/object-hash This package only supports SHA1. Is there any other way that can work to create the SHA256 from an object?
Bear Bile Farming is Torture's user avatar
-4 votes
1 answer
41 views

Is computing a unqiue hash sha from an object an expensive operation? [closed]

https://www.npmjs.com/package/object-hash var hash = require('object-hash'); hash({foo: 'bar'}) // => '67b69634f9880a282c14a0f0cb7ba20cf5d677e9' What is the maximum input object size? Is this a ...
Bear Bile Farming is Torture's user avatar
0 votes
1 answer
42 views

CRTP provide specialisation for derived classes in terms of base class for std::hash

TLDR I am trying to write a template specialisation for a bunch of derived classes only once in terms of the base class in a CRTP style framework. However, I can't get it to compile. What I am trying ...
oliversm's user avatar
  • 1,787
0 votes
0 answers
112 views

Delphi 11.3 Windows app with Indy and digest authentication fails intermittently

I'm currently writing code for interfacing with a biometric device which requires digest auth in some requests. I wrote a simple app for testing, which works well in my PC and others, but there are a ...
ogalonzo's user avatar
0 votes
1 answer
48 views

DynamoDB Query with FilterExpression not returns the expected data on limit

Here is KeyConditionExpression, FilterExpression, Limit values that I use to query data KeyConditionExpression (pk = 1122 and begins_with(sk, 'ID#') FilterExpression (code = alex@001) Limit 1 Here is ...
Suleman Elahi's user avatar
0 votes
1 answer
21 views

How to properly use Modulo in Rabin Karp algorithm?

I am trying to solve leetcode problem 187. Repeated DNA Sequences using Rabin Karp algorithm with rolling hash approach. At first, I solved the problem without using any MOD operations like below. ...
Setu Kumar Basak's user avatar
-2 votes
0 answers
39 views

How can python determine whether a specific key exists in a dictionary? [duplicate]

I just studied about hash tables, but I'm having trouble understanding, so I have a question. I understand that the hash function converts string into an index in the hash table and stores the value ...
ju so's user avatar
  • 129
0 votes
1 answer
60 views

How to override the hash function of python data classes? [duplicate]

I am trying to write a base class for python dataclasse with a custom hash function as follows. However, when calling the child class's hash it does not use the custom hash function of the parent ...
motam79's user avatar
  • 3,562
1 vote
1 answer
59 views

How to delete hash elements inside a function using scalar variable in perl

I'm facing one issue while deleting a hash key using scalar variable from another function. So I have a hash like - %larmhash = ('EntityValidation' => 'arm.account.tqLedgerDataRef.xml', 'Functions' ...
Biswajit Maharana's user avatar
1 vote
1 answer
50 views

Explain res = id^(id >>> 32), please

Hullo! I have this code public int hashCode(){ int res = (int) (id ^ (id >>> 32)); res = 31 * res + (name != null ? name.hashCode() : 0); return res; } And this ...
AishaWho's user avatar
-1 votes
0 answers
30 views

Hash values differ on same text in C# ASP.NET webforms

I have googled my query but unable to solve it. I have used SHA-1 algorithm to hash password. but when comparing it shows new hash value upon same input password(exactly same password as I stored in ...
Syeda's user avatar
  • 21
0 votes
0 answers
26 views

Is there a battle tested way of matching DOM elements between browser render and version stored in the CMS?

I am working on a small project to dynamically update tags on blog posts. The blog posts are stored in a CMS as text, and I have a javascript snippet embedded on the blog post page. I'd like to be ...
Tom's user avatar
  • 188
0 votes
0 answers
10 views

Compare two tables without being able to identify the matches in either table

Let me explain the problem. I have two tables with email addresses in each of them. Table A comes from Company A and Table B comes from Company B. The end goal is to find out number of common email ...
Imran S.'s user avatar
  • 935
0 votes
0 answers
23 views

How to eliminate duplicate quadruplets using hashtable/dictionary? Leetcode 4Sum

https://leetcode.com/problems/4sum/ I used python dictionary, an outer 2 loop with 2 inner for loop inside it. Basically, I find all the possible sums of any 2 array element combinations. Then I ...
Thonky456's user avatar
0 votes
1 answer
71 views

Order independent integer hashing?

I want to implement the Hash trait for a datatype that is defined as a list of integers and where the order does not matter. So for example {1, 2, 3} == {2, 1, 3}. I have this naive (and wrong) ...
Makogan's user avatar
  • 8,295
0 votes
0 answers
14 views

How should i store user and user_sessions as HKEY in Redis?

I have Users table which holds passwords, role, profile id and etc. Also i have tabele User_sessions which holds user_id, session_id, expirry date, user_role and few other data. Question is i want to ...
Ilgar Hidayatov's user avatar
1 vote
1 answer
49 views

What is the lookup time complexity of Consistent Hashing Design? [closed]

While reading Alex Xu's book on designing large systems, I had a question about the part about consistent hashing. The book says that in a stable hash, the server where the key will be stored is a ...
saint6839's user avatar
0 votes
1 answer
37 views

Strapi admin panel can't get loaded on vps server

I have problem with running my strapi admin panel on adress /admin. I use Ubuntu. Server is set correctly, but I think authentication can't be handled. I have error in console: Uncaught (in promise) ...
Jakub Zalewski's user avatar
0 votes
0 answers
36 views

I need a custom hash function for a dataclass that will produce the same hash for two instances of the class if any two of their attributes are equal

I need a hash function for the following class, similar to the eq method already implemented. The function should return the same hash value for two instances of the class if any of their attributes ...
natet94's user avatar
0 votes
0 answers
22 views

Caused by: java.lang.NoSuchFieldError: SECURITY_JPA_REACTIVE | Quarkus

I have built an Item API that performs CRUD function, generates an otp token now I want to hash password using BcryptUtil.bcryptHash(password) but when I add the quarkus-security-jpa-reactive ...
Plus Ultra's user avatar
0 votes
2 answers
166 views

Java Apache PDFBox - issue with generating the hash for external signing or with merging it back - adding Public key certificate chain to PDF

Problem description We have a specific business / technical case - we need to electronically sign PDFs, and to do that we're partnering with a company that handles electronic signature over the hash ...
jan_s's user avatar
  • 1
-2 votes
1 answer
63 views

Hash function for or equality

I'm working on a program that checks for incomplete data. class Contact: def __init__(self, name, phone, email): self.names = {name} if pd.notna(name) else set() self.phones = {...
Simon Van den Bossche's user avatar
0 votes
0 answers
18 views

Generate webhook signature using client_secret for Oauth 2.0 application

I'm currently developing a SAAS that allow 3rd party application to connect. On 3rd party app creation, I generate client_id and client_secret. I save a hashed version of client_secret in the database....
Steve's user avatar
  • 309
0 votes
0 answers
26 views

How can I collect data from a hash function in the most optimal way?

I'm working on a mini project where I'm comparing two hashing algorithms, specifically Robin Hood hashing and Double Hashing. My goal is to analyze and compare the performance of these algorithms in ...
user15227357's user avatar
-2 votes
1 answer
54 views

Werkzeug password encryption

I am trying to encrypt a password using werkzeug library. I don't know what why i am getting pbkdf2:sha256:600000 for every any password i try to encrypt. Here's my code import werkzeug # from hashlib ...
Parth Pawar's user avatar
0 votes
1 answer
34 views

Postgres optimizer gives different results for different values in same SQl query

I have a SQL query which is giving 2 different execution plan when the selection of language changes from "English,Portuguese" to "Dutch,Portuguese". The selection for "Dutch,...
Parth's user avatar
  • 11
0 votes
0 answers
15 views

Is there a daemon, service, utility, or program for automatically keeping track of local file content hashes?

We have a large number of files (~2,000,000), on a local disk, that we'd like to keep tabs on. An idea is to get a hash (MD5 is the first thought, though the particular algorithm isn't that important ...
Harold's user avatar
  • 1,594
1 vote
1 answer
29 views

Specifying a nested variable correctly in Ansible

I need to pull some values out of a nested dictionary in ansible and I can't seem to do it. Either I'm defining it badly or specifying it badly. And the ansible error messages are of course little ...
Danby's user avatar
  • 33
3 votes
1 answer
94 views

When does unordered_set invoke operator==?

In my thought, This was how unordered_set insertion was working. When insert was called, hash function is called. In my code below I hash first and second value in pair<string, string> each. -&...
codeDog's user avatar
  • 33
-1 votes
1 answer
39 views

Creating uuid from cryptographic hash function in Big Query

Given the table below: first_name last_name description John Kennedy Presidente of USA Elizabeth Mary Queen of UK I would like to hash the first_name and last_name column and create a UUID for ...
p.magalhaes's user avatar
  • 7,619
1 vote
1 answer
97 views

bash function to create a "content-hash" of a specific git commit

NO, I'M NOT TALKING ABOUT THE GIT COMMIT HASH!!! :) It's easy to end up with 2 git commits which have identical codebases, but different commit hashes. Perhaps you interactively rebased to re-order ...
Brondahl's user avatar
  • 7,440
-2 votes
2 answers
144 views

Detect if image is a perceptual exact duplicate

[Problem] For an application, I am looking to compare images with an original. With the comparison, I want to determine if they are an exact perceptual match. They could have different resolution e.g. ...
gaurav's user avatar
  • 872
0 votes
0 answers
11 views

How to generate strong test case for the Update Binary string problem

Problem: I have a binary string S with a length of N and Q queries: Query 1: Update all elements of string S from index u to index v to be equal to x (where x is 0 or 1). Query 2: Check if S[x..y] ...
Son Giang's user avatar
1 vote
1 answer
51 views

Many to one hash function

I don't know exactly what to call it and this is the closest thing that I can think of What I'm looking for is a function that takes an array of strings and returns a hash string like the following ...
Jalal Hejazi's user avatar

1
2 3 4 5
478