Bitcoin Forum
June 03, 2024, 12:42:03 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: SHA-256 CPU support - experiences?  (Read 56 times)
jordimetil (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 1


View Profile
May 29, 2024, 01:38:36 PM
 #1

i'm currently working on few projects, i want to use SHA-256 CPU support for hashing because it is more performant than JS native implementation. i tried to get details about this topic on web (stack overflow and few more forums), but i couldn't find clear answer to my question. if you have knowledge in cryptography, reply here Cheesy
NotATether
Legendary
*
Online Online

Activity: 1624
Merit: 6866


bitcoincleanup.com / bitmixlist.org


View Profile WWW
May 30, 2024, 07:07:36 AM
Merited by ABCbits (1)
 #2

Have you looked at this topic? https://bitcointalk.org/index.php?topic=5498106.msg64140587#msg64140587

It will probably help you.

JS cryptographic implementations will always be slow. One, because most of the time, it is a polyfill and not implemented as some C++ library - and all web apps fall into this category - so since there's a lot of math that goes into this it's quite slow. Two, you can't multi-thread it or take advantage of hardware acceleration that might be available.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ABCbits
Legendary
*
Offline Offline

Activity: 2898
Merit: 7532


Crypto Swap Exchange


View Profile
May 30, 2024, 11:25:02 AM
 #3

I'm not programmer, but how about SHA-256 library which use WebAssembly such as https://github.com/Daninet/hash-wasm? Although i don't know whether such library would work on all browser or CPU.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
NotATether
Legendary
*
Online Online

Activity: 1624
Merit: 6866


bitcoincleanup.com / bitmixlist.org


View Profile WWW
May 30, 2024, 11:33:54 AM
 #4

I'm not programmer, but how about SHA-256 library which use WebAssembly such as https://github.com/Daninet/hash-wasm? Although i don't know whether such library would work on all browser or CPU.



So basically everything made in the last decade should work fine.

WebAssembly doesn't have to worry about supporting x86 or ARM architectures itself, the browser implementations take care of that.

I'd say this is even better than my suggestion to use a different language. I mean, this is literally assembly language after all, it just runs on the browser's engine instead of on an OS.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ABCbits
Legendary
*
Offline Offline

Activity: 2898
Merit: 7532


Crypto Swap Exchange


View Profile
May 31, 2024, 08:36:22 AM
 #5

I'm not programmer, but how about SHA-256 library which use WebAssembly such as https://github.com/Daninet/hash-wasm? Although i don't know whether such library would work on all browser or CPU.


So basically everything made in the last decade should work fine.

I see, i must've missed that earlier.

WebAssembly doesn't have to worry about supporting x86 or ARM architectures itself, the browser implementations take care of that.

I'd say this is even better than my suggestion to use a different language. I mean, this is literally assembly language after all, it just runs on the browser's engine instead of on an OS.

Weird it doesn't have to worry about CPU architecture, even though the name contain word assembly. Anyway, that means it should fulfill OP needs.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!