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
23 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
0answers
49 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 ...
5
votes
2answers
61 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
66 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
56 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
126 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
91 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: <...
0
votes
0answers
121 views

Brute-force cracker for hashed passwords

I want to crack the password hash. This is my data which I want to display the username and the passwords. This is my code ...
2
votes
0answers
43 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
59 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
147 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
50 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
114 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
67 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
42 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
210 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
96 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
257 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 ...
0
votes
0answers
76 views

Yet another hash tuple in C++17

Is there something terribly wrong with this implementation? ...
2
votes
1answer
115 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
106 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
35 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
183 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
188 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
1k 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
228 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 ...
11
votes
6answers
5k 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
164 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
367 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 ...
10
votes
1answer
9k 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
1k 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
766 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
3k 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
337 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
849 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
517 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. ...
5
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
8k 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. ...
1
vote
1answer
941 views

encrypt/decrypt person data

Ahead of the General Data Protection Regulation (GDPR) I begin to crypt more than ever before, in fact, all I can crypt become crypt. However, I wonder if anybody can tell me if this code is secure ...
2
votes
1answer
491 views

Using hashing to create a PRNG with seed

So I wanted to code a simple PRNG for generating terrain in a game. It has to have the following properties: Computationally cheap Generate semi random numbers between 0 and an positive integer. I ...
4
votes
2answers
1k views

Simple hashing and salting algorithm

I have devised what I feel to be a simple hash/salting algo for Java, and am looking for some feedback from people more skilled than myself. Please find below my code; ...
1
vote
1answer
370 views

Implementing feature hashing using guava

I am trying to implement feature hashing in Java. For this I am trying to use Hashing functions from guava. This is how I am doing it now: ...
3
votes
4answers
186 views

Custom Non-Crypto Hashing Algorithm

Rule of Thumb: Don't roll your own encryption--I'm no cryptographer obviously. Also note my apologies for my awful C-style C++. For a fun little project I've written my own hash algorithm as a ...
10
votes
2answers
359 views

Python hash format converter

This program should convert a file containing Mana, Hashcat or John the Ripper NTLMv1 hashes to another file containing Hashcat or John the Ripper hashes. Do you have any suggestions on how to make ...
6
votes
1answer
812 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 ...
2
votes
2answers
627 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"], Return: [ ["ate", "eat","tea"], ["nat","...
0
votes
1answer
181 views

Hash Table or map implementation

I'd like to get feedback on whether my hash table is correct or not. Also, any ideas on performance? ...
3
votes
1answer
927 views

Rabin Karp algorithm improvement for string contains A to Z only

I have made some improvement to Rabin Karp algorithm when the source and pattern only contain the characters from A to Z. The improvement is, I use base 26 for hashing (as there are total 26 ...