forked from oven-sh/bun
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bun.js] Implement Bun.sha1, Bun.sha256, Bun.sha384, Bun.sha512, Bun.…
…sha512_384
- Loading branch information
1 parent
b3522b2
commit f6d73cb
Showing
11 changed files
with
602 additions
and
71 deletions.
There are no files selected for viewing
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
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
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,28 @@ | ||
import { it, expect } from "bun:test"; | ||
|
||
for (let Hasher of [ | ||
Bun.SHA1, | ||
Bun.SHA256, | ||
Bun.SHA384, | ||
Bun.SHA512, | ||
Bun.SHA512_256, | ||
]) { | ||
it(`${Hasher.name} instance`, () => { | ||
var buf = new Uint8Array(256); | ||
const result = new Hasher(); | ||
result.update("hello world"); | ||
result.final(buf); | ||
}); | ||
} | ||
|
||
for (let HashFn of [ | ||
Bun.sha1, | ||
Bun.sha256, | ||
Bun.sha384, | ||
Bun.sha512, | ||
Bun.sha512_256, | ||
]) { | ||
it(`${HashFn.name} instance`, () => { | ||
HashFn("hello world"); | ||
}); | ||
} |
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
3c32b2da4ba87f18 | ||
871e1d1d6a2e7805 |
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
Oops, something went wrong.