Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add nano-md5_v1.x.x * Remove toHex function * Fix default imports and add changed String class * Add test for default import
- Loading branch information
1 parent
8d18f67
commit 304d88c
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
definitions/npm/nano-md5_v1.x.x/flow_v0.65.x-/nano-md5_v1.x.x.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class ExtendedString extends String { | ||
toHex: () => string; | ||
} | ||
|
||
declare module "nano-md5" { | ||
declare module.exports: { | ||
(utf8_string: string): string; | ||
fromBytes (bytes_string: string): ExtendedString; | ||
fromUtf8 (utf8_string: string): ExtendedString; | ||
crypt (password: string, settings: string): string; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import md5 from "nano-md5"; | ||
|
||
// $ExpectError: accept only strings | ||
md5(6); | ||
|
||
const encoded: string = md5('some-string'); | ||
|
||
md5.fromUtf8('hello').toHex(); | ||
md5.fromBytes('hello').toHex(); | ||
md5.crypt('hello', '$1$01234567'); |