Questions tagged [hashcode]

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

Filter by
Sorted by
Tagged with
2
votes
0answers
83 views

Fnv1a hashing of C# Guid

I have the following implementation of the Fnv1a hashing for a string, which should be correct: ...
2
votes
1answer
86 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
0answers
31 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. ...
5
votes
2answers
59 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 ...
2
votes
1answer
19 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 ...
5
votes
1answer
71 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
0answers
32 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
2answers
70 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 ...
4
votes
1answer
174 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/...
9
votes
3answers
2k 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 ...
2
votes
1answer
39 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 ...
3
votes
1answer
71 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 ...
1
vote
1answer
167 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. ...
8
votes
3answers
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 ...
6
votes
3answers
100 views

File duplicate finder

In an attempt to clean out my picture collection I made a script to find all duplicate files ...
3
votes
1answer
74 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 ...
6
votes
1answer
106 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
2answers
272 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 ...
4
votes
2answers
144 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: <...
2
votes
0answers
48 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 ...
3
votes
0answers
160 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 ...
3
votes
3answers
151 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 ...
2
votes
1answer
57 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 ...
1
vote
1answer
129 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: ...
2
votes
2answers
79 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'. ...
0
votes
1answer
43 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 ...
2
votes
1answer
670 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 ...
0
votes
1answer
108 views

HashMap Implemention in Java

I just finished implementing a HashMap in Java, with methods: add(String key, Integer value) get(String key) ...
2
votes
1answer
635 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 ...
2
votes
2answers
135 views

Yet another hash tuple in C++17

Is there something terribly wrong with this implementation? ...
2
votes
1answer
150 views

Password encrypting tool

I wrote a tool that takes a domain name and a password, concatenates them, hashes the result with sha512, and returns the result encoded in base64 truncated to 32 characters. The main idea behind this ...
0
votes
1answer
123 views

Hash function in C for sets and associative arrays

I wrote a non-cryptographic hash function in C, which I am hoping might be suitable for use in an implementation of hash sets or hash maps. ...
4
votes
1answer
40 views

Small script to verify hash of a downloaded file

You know how whenever you download a file you should really compare the hash of the download to the one provided on the website? This makes absolute sense, but it's a pain to do it letter for letter, ...
4
votes
2answers
209 views

Find duplicate files in Linux

This code finds duplicate files in Linux. I assume that MD5 hash will return unique hash number. What can I improve in this code? ...
2
votes
1answer
417 views

HMAC algorithm implementation

I wanted to understand the HMAC algorithm. So, I implemented it as a Jupyter Notebook with all intermediate steps being output to console. My objective now is to improve it so it may serve as a ...
5
votes
1answer
2k views

Salted hash generator

I've had a go at creating a small class in C# that can generated salted hashes from text. I would like to know how this could be improved (in terms of code style) and whether or not this code is ...
5
votes
1answer
297 views

Python function to hash a python function

I'm working on a sort of distributed build system. The system allows execution of snippets of scripts as build steps. I need to be able to hash these snippets of code in a way that comments and doc ...
13
votes
6answers
8k 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 ...
4
votes
1answer
178 views

Updating data file records

I learnt to code a long, long time ago. Concerns Existing approach is messy and will be hard to maintain. System errors are not trapped and the error messages could be better implemented. Final ...
0
votes
2answers
508 views

C# Hash Code for triangle class [closed]

I have a custom class to handle some triangle calculations that I am doing. For the most part I am happy with it, however, there is one aspect that I don't really trust. That is my implementation of ...
11
votes
1answer
15k views

Self-contained SHA-256 implementation in C

I have been looking for a SHA-256 implementation in C with no dependencies (preferably self-contained in a single C-file) with a permissive license but found none to my liking. Since the Wikipedia ...
1
vote
1answer
2k views

C++ Hashing Passwords - simple algorithm using rand()

I'm studying algorithm's and got to the point of hashing.I was excited about it and I created a little hashing function which will depend on user input and generate passwords. The passwords had to ...
6
votes
1answer
2k views

Basic one way hash to store a password C#

I am storing a password in a database (school coursework so nothing too complicated but I want to challenge myself), I am using a one way hash function, is this suitable? It works I just feel there ...
-1
votes
1answer
938 views

Reading bytes from file to compute its SHA256 hash

I need to get text hash (sha 256), so I need to convert file to its type representation. Is this a fast way to get a byte representation of a file? ...
5
votes
1answer
5k 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
0answers
390 views

MD5 implementation with SSE2

My implementation of MD5 (hash function) works correctly, though it has terrible performance. As a laboratory work, I must write the algorithm myself and implement the brute force. full code with ...
5
votes
4answers
1k views

Fast case-insensitive hash-code for specific codes

I'm trying to fix another bottleneck identified with a profiler (dotTrace). This time it's a case insensitive hash-code. Currently I'm using the ...
0
votes
1answer
667 views

Using hash_file for image recognition

My team is writing software to be able to grade a basic skills in word/excel/powerpoint test. We are trying to figure out the best way to verify that they included a correct image in their word doc. ...
6
votes
2answers
3k views

Using GetHashCode in Equals

I have a scenario when I want to have a HashSet<ITrackableObjectData>, where ITrackableObjectData has ...
14
votes
1answer
12k views

MD5 implementation in C++11

I'm writing a C++ implementation of the MD5 hashing algorithm based on the pseudocode of this wikipedia article. ...