Skip to content

Commit

Permalink
updated vmc option to correctly add VMC:GS_
Browse files Browse the repository at this point in the history
  • Loading branch information
srynobio committed Mar 26, 2018
1 parent 1e6ee32 commit f8eda3a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Options:
--help, -h display this help and exit
```

Adding the `--vmc` option will return a base64 URL Encoded ID. All other options
Adding the `vmc` option will return a base64 URL Encoded ID. All other options
are self-explanatory with examples shown below.

## Installing
Expand All @@ -47,11 +47,11 @@ linux | amd64 | [linux](https://github.com/srynobio/vmccl/releases)

## Examples:

All `--stdin` and `blob` text will have newlines and spaces removed.
All `stdin` and `blob` text will have newlines and spaces removed.

#### stdin option:

This example of stdin show the output with and without the `--vmc` option added
This example of stdin show the output with and without the `vmc` option added

```
$> wc -lmw irobot.txt
Expand All @@ -61,13 +61,13 @@ $> cat irobot.txt | vmccl --stdin
mbeo1K0MZwIHizAurCs2hYwA7LMyXSX0
$> cat irobot.txt | vmccl --stdin --vmc
mbeo1K0MZwIHizAurCs2hYwA7LMyXSX0
VMC:GS_mbeo1K0MZwIHizAurCs2hYwA7LMyXSX0
$> cat irobot.txt | vmccl --stdin --length 60
mbeo1K0MZwIHizAurCs2hYwA7LMyXSX0OQtVedGfpGBChEOV4jv58F1SeXpq0K5rUGsytqHm4/1oicIh
$> cat irobot.txt | vmccl --stdin --vmc --length 60
mbeo1K0MZwIHizAurCs2hYwA7LMyXSX0OQtVedGfpGBChEOV4jv58F1SeXpq0K5rUGsytqHm4_1oicIh
VMC:GS_mbeo1K0MZwIHizAurCs2hYwA7LMyXSX0OQtVedGfpGBChEOV4jv58F1SeXpq0K5rUGsytqHm4_1oicIh
```

Expand All @@ -78,7 +78,7 @@ $> vmccl --blob "I, Robot Isaac Asimov. TO JOHN W. CAMPBELL, JR, who godfathered
p6WvpVcb0/hJj5Y/4Za3o01Ln40R+Ijz
$> vmccl --blob "I, Robot Isaac Asimov. TO JOHN W. CAMPBELL, JR, who godfathered THE ROBOTS" --vmc
p6WvpVcb0_hJj5Y_4Za3o01Ln40R-Ijz
VMC:GS_p6WvpVcb0_hJj5Y_4Za3o01Ln40R-Ijz
```

Expand All @@ -88,5 +88,5 @@ p6WvpVcb0_hJj5Y_4Za3o01Ln40R-Ijz
$> vmccl --fasta NC_000019.10.fasta
Description line: NC_000019.10 Homo sapiens chromosome 19, GRCh38.p7 Primary Assembly
VMCDigest ID: IIB53T8CNeJJdUqzn9V_JnRtQadwWCbl
VMCDigest ID: VMC:GS_IIB53T8CNeJJdUqzn9V_JnRtQadwWCbl
```
3 changes: 2 additions & 1 deletion vmccl.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ func VMCDigest(bv []byte, truncate int) string {
hasher.Write(bv)

sha := base64.URLEncoding.EncodeToString(hasher.Sum(nil)[:truncate])
return sha
vmcsha := "VMC:GS_" + sha
return vmcsha
}

// --------------------------------------------------------------------- //

0 comments on commit f8eda3a

Please sign in to comment.