Skip to content

Commit 56da628

Browse files
improve docs
1 parent 62ace35 commit 56da628

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,32 @@
33
This module represents a collection of hash functions.
44

55
## Usage Examples
6-
### CRC32
7-
8-
```ts
96

10-
import crc32 from 'https://deno.land/x/hash/mod-crc32.ts'
11-
12-
console.log(crc32.str("SheetJS"))
13-
console.log(crc32.bstr("SheetJS"))
14-
console.log(crc32.buf([83, 104, 101, 101, 116, 74, 83]))
7+
### SHA 256
158

9+
```sh
10+
deno run https://deno.land/x/hash/usage-examples/sha256.ts
1611
```
1712

18-
### SHA 256
1913

2014
```ts
2115

2216
import hashJs from 'https://deno.land/x/hash/mod-hashjs.ts'
2317

24-
console.log(hashJs.sha256().update('abc').digest('hex'))
18+
console.log(hashJs.sha256().update('Bitcoin').digest('hex'))
2519

2620
```
2721

2822

23+
24+
### CRC32
25+
26+
```ts
27+
28+
import crc32 from 'https://deno.land/x/hash/mod-crc32.ts'
29+
30+
console.log(crc32.str("SheetJS"))
31+
console.log(crc32.bstr("SheetJS"))
32+
console.log(crc32.buf([83, 104, 101, 101, 116, 74, 83]))
33+
34+
```

usage-examples/crc32.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// for details check https://www.npmjs.com/package/crc-32
2-
import crc32 from '../mod-crc32.ts'
2+
import crc32 from 'https://deno.land/x/hash/mod-crc32.ts'
33

44
console.log(crc32.str("SheetJS"))
55
console.log(crc32.bstr("SheetJS"))

usage-examples/sha256.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// for details check https://www.npmjs.com/package/hash.js
2-
import hashJs from '../mod-hashjs.ts'
2+
import hashJs from 'https://deno.land/x/hash/mod-hashjs.ts'
33

4-
console.log(hashJs.sha256().update('abc').digest('hex'))
4+
console.log(hashJs.sha256().update('Bitcoin').digest('hex'))

0 commit comments

Comments
 (0)