Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [hashcode]

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

2
votes
0answers
39 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
42 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
120 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
44 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
100 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
52 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
40 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 ...
1
vote
1answer
72 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
71 views

HashMap Implemention in Java

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

Yet another hash tuple in C++17

Is there something terribly wrong with this implementation? ...
2
votes
1answer
79 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
76 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
32 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, ...
3
votes
2answers
143 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
49 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
609 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
156 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 ...
8
votes
5answers
2k 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
154 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
228 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 ...
8
votes
1answer
4k 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
512 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
1k 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
506 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? ...
4
votes
1answer
2k 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
252 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
580 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
379 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
2k views

Using GetHashCode in Equals

I have a scenario when I want to have a HashSet<ITrackableObjectData>, where ITrackableObjectData has ...
14
votes
1answer
5k 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
810 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
335 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 ...
5
votes
2answers
612 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
296 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
184 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
354 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
616 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 ...
3
votes
2answers
322 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
162 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
677 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 ...
4
votes
1answer
256 views

Generating Signatures of Tree Structures using an Order-Independent Hash

I'm working with a file format which stores data as a tree. Each node in the tree is known as a Tag, and every tag has a name ...
-2
votes
1answer
233 views

Simple example of a hash table using square as key

I'm studying hash tables, and wrote the following to serve as a simple example. Does this properly demonstrate the basic concept of a hash table? The values are ...
1
vote
4answers
2k views

Java class to compute and get a MD5 hash as a string

Here is my class file to compute MD5 hashes on a file. I wanted to be able to easily calculate them without having to create a lot of overhead in the code using the class. Can anyone tell me a list ...
2
votes
2answers
177 views

Find combination of sets which sum up to a specified result

Example input : A) 1, 2 B) 2, 8 C) 7, 8 Required Result : 8, 10 The output from the program with this input should be A + C. Few notes : We can only combine 2 sets. There must ...
1
vote
0answers
92 views

Minimal length of substring that forms cyclic string

there is a knows problem stated as "Cyclic string": A string S has been recorded many times, and then from the resulting line took a substring, and give to you.Your task is to determine the minimum ...
5
votes
1answer
813 views

Generating unique ID of an exception

For classifying error reports, I need to generate an ID from an exception. That ID should be (more or less) unique a short alpha numeric string equal for equivalent exceptions (even on different ...
3
votes
1answer
361 views

Hash function for a key of type structure

I need to implement a hash function for a key of type structure. This structure is as follows: ...
1
vote
1answer
97 views

Finding a passcode by comparing MD5 result

This function finds the 8 char passcode from a given "doorId". Is there a way to find the passcode in an undetermined number of steps without using a while? Maybe ...
5
votes
1answer
120 views

2016 Advent of Code - Day05

Day 5: How About a Nice Game of Chess? You are faced with a security door designed by Easter Bunny engineers that seem to have acquired most of their security knowledge by watching hacking ...