Skip to content

Commit 690a9e9

Browse files
committed
Initial commit
0 parents  commit 690a9e9

File tree

159 files changed

+93462
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+93462
-0
lines changed

.gitignore

+269
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### C template
3+
# Prerequisites
4+
*.d
5+
6+
# Object files
7+
*.o
8+
*.ko
9+
*.obj
10+
*.elf
11+
12+
# Linker output
13+
*.ilk
14+
*.map
15+
*.exp
16+
17+
# Precompiled Headers
18+
*.gch
19+
*.pch
20+
21+
# Libraries
22+
*.lib
23+
*.a
24+
*.la
25+
*.lo
26+
27+
# Shared objects (inc. Windows DLLs)
28+
*.dll
29+
*.so
30+
*.so.*
31+
*.dylib
32+
33+
# Executables
34+
*.exe
35+
*.out
36+
*.app
37+
*.i*86
38+
*.x86_64
39+
*.hex
40+
41+
# Debug files
42+
*.dSYM/
43+
*.su
44+
*.idb
45+
*.pdb
46+
47+
# Kernel Module Compile Results
48+
*.mod*
49+
*.cmd
50+
.tmp_versions/
51+
modules.order
52+
Module.symvers
53+
Mkfile.old
54+
dkms.conf
55+
56+
### JetBrains template
57+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
58+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
59+
60+
# User-specific stuff
61+
.idea/**/workspace.xml
62+
.idea/**/tasks.xml
63+
.idea/**/usage.statistics.xml
64+
.idea/**/dictionaries
65+
.idea/**/shelf
66+
67+
# Generated files
68+
.idea/**/contentModel.xml
69+
70+
# Sensitive or high-churn files
71+
.idea/**/dataSources/
72+
.idea/**/dataSources.ids
73+
.idea/**/dataSources.local.xml
74+
.idea/**/sqlDataSources.xml
75+
.idea/**/dynamic.xml
76+
.idea/**/uiDesigner.xml
77+
.idea/**/dbnavigator.xml
78+
79+
# Gradle
80+
.idea/**/gradle.xml
81+
.idea/**/libraries
82+
83+
# Gradle and Maven with auto-import
84+
# When using Gradle or Maven with auto-import, you should exclude module files,
85+
# since they will be recreated, and may cause churn. Uncomment if using
86+
# auto-import.
87+
# .idea/artifacts
88+
# .idea/compiler.xml
89+
# .idea/modules.xml
90+
# .idea/*.iml
91+
# .idea/modules
92+
# *.iml
93+
# *.ipr
94+
95+
# CMake
96+
cmake-build-*/
97+
98+
# Mongo Explorer plugin
99+
.idea/**/mongoSettings.xml
100+
101+
# File-based project format
102+
*.iws
103+
104+
# IntelliJ
105+
out/
106+
107+
# mpeltonen/sbt-idea plugin
108+
.idea_modules/
109+
110+
# JIRA plugin
111+
atlassian-ide-plugin.xml
112+
113+
# Cursive Clojure plugin
114+
.idea/replstate.xml
115+
116+
# Crashlytics plugin (for Android Studio and IntelliJ)
117+
com_crashlytics_export_strings.xml
118+
crashlytics.properties
119+
crashlytics-build.properties
120+
fabric.properties
121+
122+
# Editor-based Rest Client
123+
.idea/httpRequests
124+
125+
# Android studio 3.1+ serialized cache file
126+
.idea/caches/build_file_checksums.ser
127+
128+
### C++ template
129+
# Prerequisites
130+
*.d
131+
132+
# Compiled Object files
133+
*.slo
134+
*.lo
135+
*.o
136+
*.obj
137+
138+
# Precompiled Headers
139+
*.gch
140+
*.pch
141+
142+
# Compiled Dynamic libraries
143+
*.so
144+
*.dylib
145+
*.dll
146+
147+
# Fortran module files
148+
*.mod
149+
*.smod
150+
151+
# Compiled Static libraries
152+
*.lai
153+
*.la
154+
*.a
155+
*.lib
156+
157+
# Executables
158+
*.exe
159+
*.out
160+
*.app
161+
162+
### Node template
163+
# Logs
164+
logs
165+
*.log
166+
npm-debug.log*
167+
yarn-debug.log*
168+
yarn-error.log*
169+
lerna-debug.log*
170+
171+
# Diagnostic reports (https://nodejs.org/api/report.html)
172+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
173+
174+
# Runtime data
175+
pids
176+
*.pid
177+
*.seed
178+
*.pid.lock
179+
180+
# Directory for instrumented libs generated by jscoverage/JSCover
181+
lib-cov
182+
183+
# Coverage directory used by tools like istanbul
184+
coverage
185+
*.lcov
186+
187+
# nyc test coverage
188+
.nyc_output
189+
190+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
191+
.grunt
192+
193+
# Bower dependency directory (https://bower.io/)
194+
bower_components
195+
196+
# node-waf configuration
197+
.lock-wscript
198+
199+
# Compiled binary addons (https://nodejs.org/api/addons.html)
200+
build/Release
201+
202+
# Dependency directories
203+
node_modules/
204+
jspm_packages/
205+
206+
# TypeScript v1 declaration files
207+
typings/
208+
209+
# TypeScript cache
210+
*.tsbuildinfo
211+
212+
# Optional npm cache directory
213+
.npm
214+
215+
# Optional eslint cache
216+
.eslintcache
217+
218+
# Microbundle cache
219+
.rpt2_cache/
220+
.rts2_cache_cjs/
221+
.rts2_cache_es/
222+
.rts2_cache_umd/
223+
224+
# Optional REPL history
225+
.node_repl_history
226+
227+
# Output of 'npm pack'
228+
*.tgz
229+
230+
# Yarn Integrity file
231+
.yarn-integrity
232+
233+
# dotenv environment variables file
234+
.env
235+
.env.test
236+
237+
# parcel-bundler cache (https://parceljs.org/)
238+
.cache
239+
240+
# Next.js build output
241+
.next
242+
243+
# Nuxt.js build / generate output
244+
.nuxt
245+
dist
246+
247+
# Gatsby files
248+
.cache/
249+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
250+
# https://nextjs.org/blog/next-9-1#public-directory-support
251+
# public
252+
253+
# vuepress build output
254+
.vuepress/dist
255+
256+
# Serverless directories
257+
.serverless/
258+
259+
# FuseBox cache
260+
.fusebox/
261+
262+
# DynamoDB Local files
263+
.dynamodb/
264+
265+
# TernJS port file
266+
.tern-port
267+
268+
.idea/
269+
build/

.travis.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: node_js
2+
node_js:
3+
- '0.10'
4+
- '4'
5+
- '5'
6+
- '6'
7+
- '7'
8+
- '8'
9+
- '9'
10+
- '10'

README.md

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
kryptos-multi-hashing
2+
===============
3+
4+
[![Build Status](https://travis-ci.org/Kryptos-Team/multi-hashing.png?branch=master)](https://travis-ci.org/Kryptos-Team/multi-hashing)
5+
6+
[![NPM](https://nodei.co/npm/kryptos-multi-hashing.png?downloads=true&stars=true)](https://nodei.co/npm/kryptos-multi-hashing/)
7+
8+
Cryptocurrency hashing functions for node.js.
9+
10+
11+
Algorithms
12+
----------
13+
* quark
14+
* x11
15+
* x13
16+
* x16r
17+
* x16rv2
18+
* nist5
19+
* scrypt
20+
* scryptn
21+
* scryptjane
22+
* keccak
23+
* bcrypt
24+
* skein
25+
* groestl
26+
* blake
27+
* fugue
28+
* qubit
29+
* hefty1
30+
* shavite3
31+
* cryptonight
32+
* boolberry
33+
* sha256d
34+
* lbry
35+
36+
Usage
37+
-----
38+
39+
Install
40+
41+
```bash
42+
npm install kryptos-multi-hashing
43+
```
44+
45+
So for this native Node.js add-on, you can do the following hashing algorithms
46+
47+
```javascript
48+
var multiHashing = require('kryptos-multi-hashing');
49+
50+
var algorithms = ['quark', 'x11', 'scrypt', 'scryptn', 'scryptjane', 'keccak', 'bcrypt', 'skein', 'blake'];
51+
52+
var data = new Buffer("7000000001e980924e4e1109230383e66d62945ff8e749903bea4336755c00000000000051928aff1b4d72416173a8c3948159a09a73ac3bb556aa6bfbcad1a85da7f4c1d13350531e24031b939b9e2b", "hex");
53+
54+
var hashedData = algorithms.map(function(algo){
55+
if (algo === 'scryptjane'){
56+
//scryptjane needs block.nTime and nChainStartTime (found in coin source)
57+
var yaCoinChainStartTime = 1367991200;
58+
var nTime = Math.round(Date.now() / 1000);
59+
return multiHashing[algo](data, nTime, yaCoinChainStartTime);
60+
}
61+
else{
62+
return multiHashing[algo](data);
63+
}
64+
});
65+
66+
67+
console.log(hashedData);
68+
//<SlowBuffer 0b de 16 ef 2d 92 e4 35 65 c6 6c d8 92 d9 66 b4 3d 65 ..... >
69+
70+
71+
```
72+
73+
Credits
74+
-------
75+
* [zone117x](https://github.com/zone117x) for creating this repository
76+
* [NSA](http://www.nsa.gov/) and [NIST](http://www.nist.gov/) for creation or sponsoring creation of SHA2 and SHA3 algos
77+
* [Keccak](http://en.wikipedia.org/wiki/Keccak) - Guido Bertoni, Joan Daemen, Michaël Peeters, and Gilles Van Assche
78+
* [Skein](http://en.wikipedia.org/wiki/Skein_(hash_function)) - Bruce Schneier, Stefan Lucks, Niels Ferguson, Doug Whiting, Mihir Bellare, Tadayoshi Kohno, Jon Callas and Jesse Walker.
79+
* [BLAKE](http://en.wikipedia.org/wiki/BLAKE_(hash_function)) - Jean-Philippe Aumasson, Luca Henzen, Willi Meier, and Raphael C.-W. Phan
80+
* [Grøstl](http://en.wikipedia.org/wiki/Gr%C3%B8stl) - Praveen Gauravaram, Lars Knudsen, Krystian Matusiewicz, Florian Mendel, Christian Rechberger, Martin Schläffer, and Søren S. Thomsen
81+
* [JH](http://en.wikipedia.org/wiki/JH_(hash_function)) - Hongjun Wu
82+
* [Fugue](http://en.wikipedia.org/wiki/Fugue_(hash_function)) - Shai Halevi, William E. Hall, and Charanjit S. Jutla
83+
* [scrypt](http://en.wikipedia.org/wiki/Scrypt) - Colin Percival
84+
* [bcrypt](http://en.wikipedia.org/wiki/Bcrypt) - Niels Provos and David Mazières
85+
* [X11](http://www.darkcoin.io/), [Hefty1](http://heavycoin.github.io/about.html), [Quark](http://www.qrk.cc/) creators (they just mixed together a bunch of the above algos)

0 commit comments

Comments
 (0)