Questions tagged [hashcode]

Hashcode is a result of applying a hash function to data, usually an integer.

Filter by
Sorted by
Tagged with
0 votes
1 answer
68 views

An immutable class that contains Dictionary properties and needs a distinct hash code based on those Dictionaries

I have a Job class that represents jobs in a manufacturing system. The idea is that a job requires some quantity of certain materials, and it outputs some quantity ...
J.K.'s user avatar
  • 11
0 votes
1 answer
45 views

Locality Sensitive Hashing using Random Projection method

Can you review the following Python code? ...
user366312's user avatar
1 vote
1 answer
181 views

Collecting hashes of all files in a folder and its subfolders into a dictionary in Python

What I am doing here is iterating through all the files in the parentFolder and its subfolders collecting all the hashes of all the files and putting them into a ...
lungimiranza's user avatar
5 votes
1 answer
293 views

Most compact data format for a shopping cart

I'm trying to build a format that can represent the user's cart on my website in the most compact way. The website is related to computer parts and there are 23 product categories. Each product has an ...
Raees Iqbal's user avatar
12 votes
2 answers
6k views

Laughably tiny random engine

I devised a tiny pseudo-random engine and I wondered if it would be considered decent or even good. It is based on a SHA256 implementation and uses a single 32-bytes state variable. On seeding, the ...
PinkTurtle's user avatar
2 votes
2 answers
321 views

C++ distributed enumeration alternative

Application: replacing enum type / description tags in modular software, allowing adding new enum values without updating one definition. Say we have a video processing pipeline not unlike gstreamer. ...
Stefan's user avatar
  • 813
0 votes
0 answers
278 views

Deterministically hash dictionary

I need to compute a deterministic hash for a JSON-serializable dictionary. This answer almost does the job, but there are a few problems. If dict1 == dict2 then I ...
actual_panda's user avatar
1 vote
1 answer
345 views

Password hashing for safe storage with Argon

This code snippet implements password hashing for safe storage. It uses Argon2 as hashing algorithm. The method hash_password() is used to hash and salt a password. ...
questıoner's user avatar
0 votes
2 answers
478 views

Encryption and Decryption in C

I have written a program in C, which encrypts and decrypts a c-styled string (const char *) and print the result to stdout. It ...
Darth-CodeX's user avatar
0 votes
3 answers
152 views

Hash function based on ISBN

I'm trying to create a hash function for my own custom class. It uses a string value of 4 chars as a key, which is unique to every object, which I then encode using getBytes(), the part actually used ...
EddyDantes's user avatar
1 vote
1 answer
175 views

Python: Generate SHA3 hashes for files with custom rate and capacity values

I am working on a project which requires comparing the performance of SHA3 on different values of rate and capacity. I have implemented the same in Python and my program works fine, however, the ...
Ankush Soni's user avatar
2 votes
1 answer
868 views

Hashing with python optimization, hashlib and multiprocessing

I am looking to get any type of improvement, I want to be able to hash a list of 'blocks' aka strings and check if hashes match per block, if you can help me with that, currently reading and writing ...
R0Best's user avatar
  • 75
1 vote
1 answer
88 views

A simple Java integer integer hash set - follow-up 2

(See the previous version.) Now I have this: com.github.coderodde.util.IntHashSet: ...
coderodde's user avatar
  • 27k
6 votes
4 answers
1k views

A simple Java integer hash set

(See the next version.) The following data structure implements a hash table based set for int values: ...
coderodde's user avatar
  • 27k
5 votes
1 answer
3k views

Login system using bcrypt and MySQL, to be used for any future projects

Main function will ask what the user wants to do. LoginSystem class will handle the sign up and login process as well with the checking if password is right. passwordHashing will use bcrpyt to salt ...
drakebakincake's user avatar
0 votes
1 answer
82 views

Optimizing PowerShell string hasher method

I am building a PowerShell class based tool that works with XML files of as much as a few hundred Kb size, and as many as a hundred of these files. I have extensive validation code that is time ...
Gordon in Ukraine's user avatar
5 votes
1 answer
306 views

Cracking a 4x hashed md5 with a couple of hints

I made this project in my free time to try to crack a 4x hashed md5 with a couple of hints but I'm looking for ways I can optimize this algo because it's pretty slow and I know you could probs use ...
TransmissionsDev's user avatar
1 vote
0 answers
113 views

HaveIBeenPwned API

Please find my code for securely checking Haveibeenpwned for breached passwords This code will only send a partial HASH over the internet (using HTTPS) and the second part of the HASH will be checked ...
EML's user avatar
  • 2,033
4 votes
1 answer
172 views

SHA256 password cracker - v2 with concurrency

I have updated my previous code with the suggestions. I have also implemented concurrency to speed up the results. I'd be interested for comments on a more efficient use on concurrency / parallel ...
EML's user avatar
  • 2,033
3 votes
1 answer
2k views

SHA256 password cracker - brute force

I wrote a SHA256 password cracker. I initially used lists to store the information in list1.txt and list2.txt but I would end up ...
EML's user avatar
  • 2,033
2 votes
0 answers
335 views

Fnv1a hashing of C# Guid

I have the following implementation of the Fnv1a hashing for a string, which should be correct: ...
yngling's user avatar
  • 121
2 votes
1 answer
2k views

constexpr hash function

Here's a constexpr hash function, that will pack a string into the largest unsigned integral type available. So, what do you think? ...
user1095108's user avatar
  • 1,414
2 votes
0 answers
38 views

Basic login by username logic with SQL Server

My goal is to make a very simple library with the authentications basics: create a user and save its hashed password, change its password, have a method to check if the password is correct for login. ...
user avatar
6 votes
2 answers
153 views

Iter 2: Reusable, robust c++ std::hash<mpz_class> for GMP's big integer type

This is the 2nd iteration of a code review. The 1st iteration (completed) is at Iter 1: Reusable, robust c++ std::hash<mpz_class> for GMP's big integer type 1. Goal My intention is to ...
Daniel S.'s user avatar
  • 224
2 votes
1 answer
33 views

Checking hierarchical config files for hashed id and informing the user of changes

Our testing suite is configured using a type of hierarchical config file similar to .ini or .toml files. Each 'block' is a test ...
dylanjm's user avatar
  • 225
6 votes
1 answer
190 views

Iter 1: Reusable, robust c++ std::hash<mpz_class> for GMP's big integer type

This Q&A was iteration 1. Now there is Iter 2: Reusable, robust c++ std::hash<mpz_class> for GMP's big integer type 1. Goal My intention is to provide a fast hashing algorithm to hash ...
Daniel S.'s user avatar
  • 224
1 vote
0 answers
110 views

SHA-256 implementation in JS (core codes)

As told by experts, I am re-posting the code review request with the code. Brief Description: from outside sha256() will be called with parameter having UTF-16 character set. then after prepareData()...
Sayan Shankhari's user avatar
1 vote
2 answers
469 views

HashMap Implementation (dictionary) in Python

I attempted making a hashmap in python, and it was harder, due to some limitations but this is my version of dictionaries in python. Are there any way to simplify or do the same thing in less code ...
Anonymous's user avatar
  • 1,204
4 votes
1 answer
202 views

Securely hash passwords

Since hashing algorithms isn't something to mess around with as a beginner. Several howto's explain that one should use already made solutions. Examples of such pages: https://crackstation.net/...
brat's user avatar
  • 153
8 votes
3 answers
3k views

Simple hashing algorithm

TL;DR: The algorithm receives a string as input, allocate another string to be the final digest, and start working on them. For each char on the digest (a null character on a first moment), it XORs it ...
thzoid's user avatar
  • 83
2 votes
1 answer
108 views

Custom code for MD5 in js [closed]

I wanted to write my own code for md5 in javascript and learn its inner mechanics. (I know it is not trusted anymore, deprecated, ... but I'm just learning). I didn't want to just copy the code that ...
Franartur Čech's user avatar
3 votes
1 answer
122 views

CliwPw - Yet Another Python3 Password Manager

I wrote a (very) simply Python3 password manager to familiarize myself with Sqlite3, and for fun. I am aware that there are already a variety of password managers out there, but I wanted something ...
Chev_603's user avatar
  • 161
1 vote
1 answer
269 views

InternedString as alternative to regular String

I need to use large strings as a dictionary keys, and I want to optimize the repetitive GetHashCode() and Equals() calls in it. ...
astef's user avatar
  • 217
8 votes
3 answers
2k views

Tiny URL creator

Coding challenge: Convert a given long URL into a Tiny URL. The length of this Tiny URL should be fixed and the same for all URLs. You should return the full URL if given a shortened URL. I am ...
EML's user avatar
  • 2,033
6 votes
3 answers
150 views

File duplicate finder

In an attempt to clean out my picture collection I made a script to find all duplicate files ...
Maarten Fabré's user avatar
3 votes
1 answer
169 views

Hashing array of strings as Merkle tree in one function

I want to hash an array of strings into one hash as shown on scheme on the image below. But I do not want to implement some class based Merkle tree. It's just a simple function. Is this a good ...
Michal's user avatar
  • 131
6 votes
1 answer
243 views

Irreversibly hash email addresses while preserving format/entropy

I'm looking to irreversibly hash valid email addresses which have been parsed from mail log data as part of a machine learning project. I need to ensure that the processed data has been scrubbed of ...
Prassein's user avatar
7 votes
2 answers
835 views

Finding collisions of the first few bits of a SHA-1 hash

My objective is to find a hash collision of my modified hash function. Assuming my modified hash only outputs the first 36 bits of SHA-1. As we know, SHA-1 is a 160-bit hash value, hence, we only need ...
Astral Zhang's user avatar
4 votes
2 answers
597 views

F# wrapper to generate SHA256 signature for a file

I've created the following module to allow me to generate a SHA256 signature for a file. (In real life this is used to verify an image file hasn't been amended). The cut down code looks like this: <...
Jackson's user avatar
  • 507
2 votes
0 answers
59 views

Database code for Python-based URL shortener

I had implemented a URL shortener with Python and a database. Please review the database part of the code. The idea is to create an MD5 hash of the URL in question and then store it in a database. The ...
Suryasis Paul's user avatar
3 votes
0 answers
532 views

Locality Sensitive Hash (similar to k-Nearest Neighbor), in Python+Numpy

I've tried implementing Locality Sensitive Hash, the algorithm that helps recommendation engines, and powers apps like Shazzam that can identify songs you heard at restaurants. LSH is supposed to run ...
Josh.F's user avatar
  • 187
3 votes
3 answers
177 views

Find MD5-hash whose hexadecimals starts like digits of π

I saw a programming puzzle. Find a string containing letters from a to z such that its MD5-hash starts like 314159265359. I am a junior programmer so I would like to know if I can solve the problem ...
guest's user avatar
  • 31
2 votes
1 answer
85 views

Password generator + storage console app

This is my code to generate and store password localy hashed in txt file. I would like to kindly ask you whether you could review my code. Btw it is coded as console app. I am currently working on ...
Matej Novosad's user avatar
1 vote
1 answer
145 views

Hashing interview puzzle

I've stumbled upon this pretty old article about a hashing interview question, and here it is converted to Swift in a more generic way: ...
ielyamani's user avatar
  • 869
2 votes
2 answers
151 views

Checking hash and passwords with a wordlist, more efficient

I have done a small code in which with a wordlist (out68.lst) I get the passwords from the hashes in the file 'shadow3'. ...
19mike95's user avatar
  • 123
0 votes
1 answer
54 views

Make password/hash verification algorithm more efficient

I am trying to guess the paswords from the etc/shadow file(it has 43 user/passwords). And I have been given some hits about the passwords: Length is between 4 and 8 characters There can be only 2 ...
19mike95's user avatar
  • 123
2 votes
1 answer
2k views

SHA-1 and MD5 BruteForce in Python 3.7

I've made a python program that can brute-force both MD5 and SHA1 hashes, and I would like know if I could make the program faster or any way I could improve it. I'm still a beginner in python and in ...
Thewizy's user avatar
  • 319
0 votes
1 answer
117 views

HashMap Implemention in Java

I just finished implementing a HashMap in Java, with methods: add(String key, Integer value) get(String key) ...
Henry Zhu's user avatar
  • 101
2 votes
1 answer
1k views

Using Java to implement a hash table (dictionary) with only arrays

I'm new to hash codes/hash tables, so I'm very unsure of my implementation. I want to create a hash table, but I can only use arrays. Specifically, I want to be able to insert things like a dictionary ...
user9597527's user avatar
2 votes
2 answers
365 views

Yet another hash tuple in C++17

Is there something terribly wrong with this implementation? ...
user1095108's user avatar
  • 1,414