Questions tagged [hashcode]
Hashcode is a result of applying a hash function to data, usually an integer.
134
questions
1
vote
1
answer
148
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 ...
5
votes
1
answer
288
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 ...
2
votes
2
answers
291
views
myhash - library with hash functions
I had a file with 2 hash functions (DJB2, NMEA0183), written in C-like way, e.g. something like this:
...
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 ...
2
votes
2
answers
197
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. ...
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 ...
0
votes
0
answers
107
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 ...
0
votes
2
answers
155
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 ...
2
votes
1
answer
663
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 ...
5
votes
1
answer
302
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 ...
0
votes
3
answers
143
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 ...
1
vote
1
answer
182
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. ...
1
vote
1
answer
136
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 ...
1
vote
0
answers
82
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 ...
4
votes
1
answer
124
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 ...
3
votes
1
answer
1k
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 ...
6
votes
1
answer
8k
views
Check website for update
I have written a program in Python that checks websites for updates (it checks in anything on the website changes) and notifies the user. The idea is downloading the webpage, stripping HTML tags off ...
1
vote
1
answer
84
views
A simple Java integer integer hash set - follow-up 2
(See the previous version.)
Now I have this:
com.github.coderodde.util.IntHashSet:
...
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:
...
2
votes
2
answers
2k
views
Leetcode 49: Group Anagrams - Hash function design talk
problem statement
Given an array of strings, group anagrams together.
For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"],
...
0
votes
1
answer
70
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 ...
8
votes
1
answer
10k
views
Hashing a tuple in C++17
C++ doesn't supply a std::hash<std::tuple<...>>, so I decided to implement one. However, I was viewing this as more of a hash library than extensions to ...
14
votes
6
answers
11k
views
Calculate fingerprint for an object
I need to store serialized objects in a database and I want to avoid duplicates. In order to be able to tell wheter an object is already stored, I have to compare them somehow. My idea was to ...
11
votes
2
answers
4k
views
Extending CGPoint to conform to Hashable
For Advent of Code Day 1, I found myself needing to use a tuple as a key in a dictionary. Seeing that I can't extend tuples in Swift, I decided to extend CGPoint ...
2
votes
2
answers
291
views
Yet another hash tuple in C++17
Is there something terribly wrong with this implementation?
...
2
votes
0
answers
286
views
Fnv1a hashing of C# Guid
I have the following implementation of the Fnv1a hashing for a string, which should be correct:
...
2
votes
1
answer
1k
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?
...
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.
...
6
votes
2
answers
140
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 ...
5
votes
1
answer
173
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 ...
2
votes
1
answer
30
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 ...
1
vote
0
answers
87
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()...
1
vote
2
answers
431
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 ...
6
votes
3
answers
149
views
File duplicate finder
In an attempt to clean out my picture collection I made a script to find all duplicate files
...
7
votes
2
answers
2k
views
HKDF Implementation in C#
Based on my prior question about HKDF here https://crypto.stackexchange.com/questions/43933/use-of-pbkdf2-when-no-access-to-hkdf and the responses I received I decided to go ahead an implement HKDF ...
9
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 ...
4
votes
1
answer
198
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/...
2
votes
1
answer
84
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 ...
1
vote
1
answer
236
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.
...
3
votes
1
answer
114
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 ...
4
votes
2
answers
388
views
Wrapper class for adding elements to HashSet
I have many object of class Test. I want to be sure that among them, there are no two objects o1 and ...
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 ...
9
votes
1
answer
253
views
One way encoding a password
I wrote a script that one way encrypts a user's password by generating a key, and multiplies by the ASCII value of the character and the ASCII value of the key character at (the position that the ...
3
votes
1
answer
154
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 ...
3
votes
3
answers
349
views
A hash-signature-type which tests on comparing against normal strings
I decided to throw this together today figuring it would be cool to add to my repertoire. Before we always had performed this "task" externally. Find the value we want to compare, hash it and compare ...
6
votes
1
answer
232
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 ...
7
votes
2
answers
733
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 ...
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 ...
4
votes
2
answers
566
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:
<...
3
votes
3
answers
168
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 ...