Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Commit

Permalink
Fix init
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Jul 16, 2018
1 parent a4cf41e commit d1c1537
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ target/sourmash.h: src/lib.rs src/ffi.rs src/errors.rs
-rm -rf ${tempdir}

wasm:
wasm-pack init
wasm-pack init --mode no-installs

.phony: test
15 changes: 10 additions & 5 deletions src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ impl KmerMinHash {
scaled: u32,
track_abundance: bool,
) -> KmerMinHash {
if scaled == 0 {
}
let max_hash = if scaled == 0 {
let max_hash = if num != 0 {
0
} else if scaled == 0 {
u64::max_value()
} else {
u64::max_value() / scaled as u64
Expand All @@ -28,8 +28,13 @@ impl KmerMinHash {
}

#[wasm_bindgen]
pub fn add_sequence_js(&mut self, buf: &[u8]) {
self.add_sequence(buf, true);
pub fn add_sequence_js(&mut self, buf: &str) {
self.add_sequence(buf.as_bytes(), true);
}

#[wasm_bindgen]
pub fn add_hash_js(&mut self, h: u64) {
self.add_hash(h);
}

#[wasm_bindgen]
Expand Down

0 comments on commit d1c1537

Please sign in to comment.