File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -4,24 +4,27 @@ import { Hasher } from "./hasher.ts";
44
55const isDeno = typeof ( globalThis as any ) . Deno !== "undefined" ;
66
7- const cmd = isDeno
8- ? "deno run https://deno.land/x/inthash/cli.ts"
9- : "npx inthash" ;
7+ const cmd = isDeno ? "deno run jsr:@denostack/inthash/cli" : "npx inthash" ;
108
11- const args = parse (
12- isDeno
13- ? ( globalThis as any ) . Deno . args
14- : ( globalThis as any ) . process . argv . slice ( 2 ) ,
15- ) ;
9+ const rawArgs = isDeno
10+ ? ( globalThis as any ) . Deno . args
11+ : ( globalThis as any ) . process . argv . slice ( 2 ) ;
12+ const cmdSuffix = rawArgs . join ( " " ) ;
13+ const args = parse ( rawArgs ) ;
1614
17- const options = Hasher . generate ( args . b ?? args . bit ?? args . bits ?? 53 ) ;
15+ const bit = args . b ?? args . bit ?? args . bits ?? 53 ;
16+ const options = Hasher . generate ( bit ) ;
1817
1918console . log ( JSON . stringify ( options , null , " " ) ) ;
2019console . error ( `
20+ $ ${ cmd } ${ cmdSuffix ? " " + cmdSuffix : "" } | pbcopy
2121
22- $ ${ cmd } | pbcopy
22+ Now go ahead and paste it into your code! Good luck. :-)
2323
24- then paste to your code! :-) good luck.` ) ;
24+ Note: The supported range of integers is from min: 0 to max: ${
25+ ( 1n << BigInt ( bit ) ) - 1n
26+ } .
27+ Please make sure your inputs fall within this range.` ) ;
2528
2629type Args = {
2730 b ?: number ;
You can’t perform that action at this time.
0 commit comments