Skip to content

Commit 978fad4

Browse files
authored
Merge pull request #2 from halvardssm/feat/crypto-hash
Feat/crypto hash
2 parents 4f5bab3 + 1f0ab8e commit 978fad4

27 files changed

+6119
-5
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,12 @@ jobs:
7272
with:
7373
deno-version: canary
7474

75-
- name: Format
75+
- name: Format & Lint
7676
run: deno task check
7777

78+
- name: Build
79+
run: deno task build:check
80+
7881
publish-dry-run:
7982
runs-on: ubuntu-latest
8083
timeout-minutes: 30

.github/workflows/publish.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ jobs:
2222
with:
2323
deno-version: canary
2424

25-
- name: Check
25+
- name: Format & Lint
2626
run: deno task check
2727

28+
- name: Build
29+
run: deno task build:check
30+
2831
- name: Test
2932
run: deno task test
3033

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ html_cov/
99
cov.lcov
1010
coverage/
1111
docs/
12+
crypto/hash/_wasm/target

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to
7+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8+
9+
## [Unreleased]
10+
11+
### Added
12+
13+
- feat(http): added package
14+
- feat(http/header): added IANA HTTP headers
15+
- feat(http/method): added IANA HTTP methods
16+
- feat(crypto): added package
17+
- feat(http/hash): added argon2 hash
18+
- feat(http/hash): added bcrypt hash
19+
20+
## [0.0.2] - 2024-04-28
21+
22+
### Added
23+
24+
- chore(core): added documentation
25+
26+
## [0.0.1] - 2024-04-28
27+
28+
### Added
29+
30+
- feat(core): implemented initial codebase
31+
- feat(encoding): added package
32+
- feat(encoding/hex): added hexdump

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ console.log(dump(buffer));
4444

4545
## Packages
4646

47+
- [crypto](https://jsr.io/@stdext/crypto): The crypto package contains utility
48+
for crypto and hashing
4749
- [encoding](https://jsr.io/@stdext/encoding): The encoding package contains
48-
helpers for text encoding.
50+
utility for text encoding.
51+
- [http](https://jsr.io/@stdext/http): The http package contains utility for
52+
fetching and http servers
4953

5054
## Versioning
5155

RELEASES.md

Whitespace-only changes.

crypto/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# @stdext/crypto
2+
3+
The Crypto package contains utilities for encryption and decryption as well as
4+
hashing.
5+
6+
## Entrypoints
7+
8+
### Hash
9+
10+
The hash module contains helpers and implementations for password hashing.
11+
12+
The following algorithms are provided:
13+
14+
- Argon2
15+
- Bcrypt

crypto/deno.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"version": "0.0.2",
3+
"name": "@stdext/crypto",
4+
"lock": false,
5+
"exports": {
6+
"./hash": "./hash.ts"
7+
},
8+
"tasks": {
9+
"build": "deno task build:argon2 && deno task build:bcrypt",
10+
"build:check": "deno task build:argon2:check && deno task build:bcrypt:check",
11+
"build:wasm": "deno task --cwd hash/_wasm wasmbuild --js-ext mjs --sync",
12+
"build:argon2": "deno task build:wasm --project deno_stdext_crypto_hash_wasm_argon2",
13+
"build:argon2:check": "deno task build:argon2 --check",
14+
"build:bcrypt": "deno task build:wasm --project deno_stdext_crypto_hash_wasm_bcrypt",
15+
"build:bcrypt:check": "deno task build:bcrypt --check",
16+
"wasmbuild": "deno run -A jsr:@deno/wasmbuild@0.17.1",
17+
"format": "cd hash/_wasm && cargo fmt --all",
18+
"format:check": "cd hash/_wasm && cargo fmt --all -- --check"
19+
}
20+
}

crypto/hash.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Utilities for data hashing.
3+
* @module
4+
*
5+
* ```ts
6+
* const hasher = new PasswordHash();
7+
* const hash = hasher.hash("password");
8+
* hasher.verify("password", hash));
9+
* ```
10+
*/
11+
12+
export * from "./hash/mod.ts";

crypto/hash/_wasm/.rustfmt.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
max_width = 80
2+
tab_spaces = 2
3+
edition = "2021"

0 commit comments

Comments
 (0)