Skip to content

Commit

Permalink
chore(std/hash): update crates (denoland#7631)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacasonato committed Sep 22, 2020
1 parent f601721 commit cf0c491
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 83 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
gclient_config.py_entries
/gh-pages/
/target/
/std/hash/_wasm/target

# Files that help ensure VSCode can work but we don't want checked into the
# repo
Expand Down
116 changes: 53 additions & 63 deletions std/hash/_wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 13 additions & 10 deletions std/hash/_wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@ repository = "https://github.com/denoland/deno"
crate-type = ["cdylib"]

[dependencies]
digest = "0.8.1"
md2 = "0.8"
md4 = "0.8"
md-5 = "0.8"
ripemd160 = "0.8.0"
ripemd320 = "0.8.0"
sha-1 = "0.8.2"
sha2 = "0.8.2"
sha3 = "0.8.2"
wasm-bindgen = "0.2.63"
digest = "0.9.0"
md2 = "0.9.0"
md4 = "0.9.0"
md-5 = "0.9.1"
ripemd160 = "0.9.1"
ripemd320 = "0.9.0"
sha-1 = "0.9.1"
sha2 = "0.9.1"
sha3 = "0.9.1"
wasm-bindgen = "0.2.68"

[profile.release]
lto = true
opt-level = 3

[package.metadata.wasm-pack.profile.release]
wasm-opt = ["-O", "--enable-mutable-globals"]
1 change: 1 addition & 0 deletions std/hash/_wasm/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ async function generate(wasm: string, output: string): Promise<void> {
const denoHashScript =
"/* eslint-disable */\n" +
"//deno-fmt-ignore-file\n" +
"//deno-lint-ignore-file\n" +
`import * as base64 from "../../encoding/base64.ts";` +
`export const source = base64.decode("${wasm}");` +
initScript;
Expand Down
4 changes: 2 additions & 2 deletions std/hash/_wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ pub fn create_hash(algorithm: &str) -> Result<DenoHash, JsValue> {

#[wasm_bindgen]
pub fn update_hash(hash: &mut DenoHash, data: &[u8]) {
hash.inner.input(data)
hash.inner.update(data)
}

#[wasm_bindgen]
pub fn digest_hash(hash: &mut DenoHash) -> Box<[u8]> {
hash.inner.result_reset()
hash.inner.finalize_reset()
}
23 changes: 15 additions & 8 deletions std/hash/_wasm/wasm.js

Large diffs are not rendered by default.

0 comments on commit cf0c491

Please sign in to comment.