Code Monkey home page Code Monkey logo

cudasha256's People

Contributors

69b69t avatar horkyze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cudasha256's Issues

Cannot handle files > 4GB

As the title says, the file API used does not allow working with files larger than 4 GB. With cards that have up to 24 GB of VRAM like 3090 RTX and with fast SSDs that would probably be a better use case than doing sha256 on a GPU for a bunch of small files where just the latency of the request is going to hide all the benefits of fast calculation.

Consider changing file API to something that can handle 64-bit file sizes, and consider using ptrdiff_t instead of char for pointer arithmetic.

Need help simplifying this to hash lines of text file

I was trying to use your code as a starting point to make a sha256 cuda hasher that takes lines from stdin (Or any text file) and hashes each line as a job (Outputing HASH and Original Line in the output separated by a space or other delimiter)

Your program is so close to doing this (You hash filesystem files), but my c++ is weak. Can you assist me? The way you read the files in for the โ€“f switch, but instead of getting the file data from get_file_data, could you just hash the string?

incorrect hashes

Hashing "hello world!" should return 7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9, and hashing that in a file works, when i try to use the api to hash "hello world!", it gives a totally incorrect hash.

(code that produces incorrect result)

#include <stdio.h>
#include <stdint.h>
#include "sha256.cuh"


__global__ void seedHash()
{
    uint8_t testInput[] = "hello world!";

    //memcpy(byteArray, &seed, sizeof(uint64_t));

    uint8_t byteArray[32];
    SHA256_CTX sha;
    sha256_init(&sha);
    sha256_update(&sha, testInput, 12);
    sha256_final(&sha, byteArray);

    printf("Hash output: ");
    for (int i = 0; i < 32; i++) printf("%.2x", byteArray[i]);
    printf("\n");
}

int main()
{
    //cudaSetDevice(1);
    seedHash<<<1,1>>>();
    cudaDeviceSynchronize();
}

No Licence file

HI @Horkyze!

I'd like to give this a go in a school project I'm working on, however there is no licence.md or information on reuse.

May I use it?

Hello, may I ask for your help?

Hello, may I ask for your help?

After I modify the code, I get an incorrect hash value.

		buff = (BYTE *)"abc";
		checkCudaErrors(cudaMallocManaged(&buff, (3)*sizeof(char)));
		jobs[i] = JOB_init(buff, 3, argv[index]);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.